mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/CSS: Stop inserting whitespace when serializing component values
Now that we don't remove whitespace when parsing, we don't need to artificially insert it back in again when serializing. We do now need to trim leading and trailing whitespace from UnresolvedStyleValues, as this previously was done as part of the whitespace insertion. This makes our serialization of UnresolvedStyleValues more correct and gets us a few WPT passes for each property in the Typed OM tests.
This commit is contained in:
parent
427d7fabd7
commit
61a0898f5f
Notes:
github-actions[bot]
2025-11-03 11:25:01 +00:00
Author: https://github.com/AtkinsSJ
Commit: 61a0898f5f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6646
Reviewed-by: https://github.com/tcl3
13 changed files with 45 additions and 53 deletions
|
|
@ -199,11 +199,9 @@ String serialize_a_css_declaration(StringView property, StringView value, Import
|
|||
}
|
||||
|
||||
// https://drafts.csswg.org/css-syntax/#serialization
|
||||
String serialize_a_series_of_component_values(ReadonlySpan<Parser::ComponentValue> component_values, InsertWhitespace insert_whitespace)
|
||||
String serialize_a_series_of_component_values(ReadonlySpan<Parser::ComponentValue> component_values)
|
||||
{
|
||||
// FIXME: There are special rules here where we should insert a comment between certain tokens. Do that!
|
||||
if (insert_whitespace == InsertWhitespace::Yes)
|
||||
return MUST(Infra::strip_and_collapse_whitespace(MUST(String::join(' ', component_values))));
|
||||
return MUST(String::join(""sv, component_values));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue