LibWeb/CSS: Remove unwanted newline from list serialization

Gets us 1 subtest pass.
This commit is contained in:
Sam Atkins 2024-11-28 16:26:57 +00:00 committed by Andreas Kling
commit 917d659f8b
Notes: github-actions[bot] 2024-11-30 10:03:16 +00:00
2 changed files with 7 additions and 4 deletions

View file

@ -31,14 +31,17 @@ String serialize_a_string(StringView string);
String serialize_a_url(StringView url);
String serialize_a_srgb_value(Color color);
// https://www.w3.org/TR/cssom/#serialize-a-comma-separated-list
template<typename T, typename SerializeItem>
void serialize_a_comma_separated_list(StringBuilder& builder, Vector<T> const& items, SerializeItem serialize_item)
{
// To serialize a comma-separated list concatenate all items of the list in list order
// while separating them by ", ", i.e., COMMA (U+002C) followed by a single SPACE (U+0020).
for (size_t i = 0; i < items.size(); i++) {
auto& item = items.at(i);
serialize_item(builder, item);
if ((i + 1) < items.size()) {
builder.append(",\n"sv);
builder.append(", "sv);
}
}
}

View file

@ -6,8 +6,8 @@ Rerun
Found 687 tests
463 Pass
224 Fail
464 Pass
223 Fail
Details
Result Test Name MessagePass background-attachment: scroll
Pass background-attachment: fixed
@ -331,7 +331,7 @@ Fail content: url("http://localhost/")
Fail content: url(http://localhost/)
Fail content: counter(par-num)
Fail content: counter(par-num, decimal)
Fail content: counter(par-num, upper-roman)
Pass content: counter(par-num, upper-roman)
Pass content: attr(foo-bar)
Pass content: attr(foo_bar)
Fail content: attr(|bar)