From 26293114d890e942e6256776b351fc155c394b16 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sat, 14 Jun 2025 06:13:53 +0100 Subject: [PATCH] LibWeb/CSS: Treat repeated `text-decoration-line` values as invalid --- Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp | 2 +- .../parsing/text-decoration-line-invalid.txt | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index 95d8c0193bb..9f2eb7e20c8 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -3537,7 +3537,7 @@ RefPtr Parser::parse_text_decoration_line_value(TokenStream includes_spelling_or_grammar_error_value = true; } if (style_values.contains_slow(value)) - break; + return nullptr; style_values.append(move(value)); continue; } diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/parsing/text-decoration-line-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/parsing/text-decoration-line-invalid.txt index 7942077e659..3bd45454d93 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/parsing/text-decoration-line-invalid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text-decor/parsing/text-decoration-line-invalid.txt @@ -2,8 +2,7 @@ Harness status: OK Found 14 tests -12 Pass -2 Fail +14 Pass Pass e.style['text-decoration-line'] = "auto" should not set the property value Pass e.style['text-decoration-line'] = "null" should not set the property value Pass e.style['text-decoration-line'] = "noone" should not set the property value @@ -12,9 +11,9 @@ Pass e.style['text-decoration-line'] = "over-line" should not set the property v Pass e.style['text-decoration-line'] = "linethrough" should not set the property value Pass e.style['text-decoration-line'] = "none underline" should not set the property value Pass e.style['text-decoration-line'] = "none spelling-error" should not set the property value -Fail e.style['text-decoration-line'] = "underline underline" should not set the property value +Pass e.style['text-decoration-line'] = "underline underline" should not set the property value Pass e.style['text-decoration-line'] = "underline none overline" should not set the property value -Fail e.style['text-decoration-line'] = "blink line-through blink" should not set the property value +Pass e.style['text-decoration-line'] = "blink line-through blink" should not set the property value Pass e.style['text-decoration-line'] = "spelling-error overline" should not set the property value Pass e.style['text-decoration-line'] = "spelling-error grammar-error" should not set the property value Pass e.style['text-decoration-line'] = "blink underline line-through grammar-error" should not set the property value \ No newline at end of file