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:
Sam Atkins 2025-10-30 16:14:54 +00:00
parent 427d7fabd7
commit 61a0898f5f
Notes: github-actions[bot] 2025-11-03 11:25:01 +00:00
13 changed files with 45 additions and 53 deletions

View file

@ -47,11 +47,6 @@ void serialize_a_comma_separated_list(StringBuilder& builder, Vector<T> const& i
String serialize_a_css_declaration(StringView property, StringView value, Important = Important::No);
enum class InsertWhitespace : u8 {
No,
Yes,
};
// FIXME: Remove InsertWhitespace param once style value parsing stops discarding whitespace tokens.
String serialize_a_series_of_component_values(ReadonlySpan<Parser::ComponentValue>, InsertWhitespace = InsertWhitespace::No);
String serialize_a_series_of_component_values(ReadonlySpan<Parser::ComponentValue>);
}