From bc17a3c2eb31e77d8db83010a32b560402c84973 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Thu, 28 Nov 2024 16:36:07 +0000 Subject: [PATCH] LibWeb: Correctly skip "decimal" in counter() serialization It's not a keyword, it's a custom-ident. The simplest way of comparing is by serializing it as a string. This gets us 2 subtest passes. --- Libraries/LibWeb/CSS/StyleValues/CounterStyleValue.cpp | 2 +- .../expected/wpt-import/css/cssom/serialize-values.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Libraries/LibWeb/CSS/StyleValues/CounterStyleValue.cpp b/Libraries/LibWeb/CSS/StyleValues/CounterStyleValue.cpp index 29744f1d59..eb766f6350 100644 --- a/Libraries/LibWeb/CSS/StyleValues/CounterStyleValue.cpp +++ b/Libraries/LibWeb/CSS/StyleValues/CounterStyleValue.cpp @@ -151,7 +151,7 @@ String CounterStyleValue::to_string() const list.append(CustomIdentStyleValue::create(m_properties.counter_name)); if (m_properties.function == CounterFunction::Counters) list.append(StringStyleValue::create(m_properties.join_string.to_string())); - if (m_properties.counter_style->to_keyword() != Keyword::Decimal) + if (m_properties.counter_style->to_string() != "decimal"sv) list.append(m_properties.counter_style); // 5. Let each item in list be the result of invoking serialize a CSS component value on that item. diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/cssom/serialize-values.txt b/Tests/LibWeb/Text/expected/wpt-import/css/cssom/serialize-values.txt index 6078de42eb..b6b0840e7c 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/cssom/serialize-values.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/cssom/serialize-values.txt @@ -6,8 +6,8 @@ Rerun Found 687 tests -464 Pass -223 Fail +466 Pass +221 Fail Details Result Test Name MessagePass background-attachment: scroll Pass background-attachment: fixed @@ -329,8 +329,8 @@ Pass content: "string" Pass content: 'string' Fail content: url("http://localhost/") Fail content: url(http://localhost/) -Fail content: counter(par-num) -Fail content: counter(par-num, decimal) +Pass content: counter(par-num) +Pass content: counter(par-num, decimal) Pass content: counter(par-num, upper-roman) Pass content: attr(foo-bar) Pass content: attr(foo_bar)