diff --git a/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp b/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp index ebeb794079d..6eb2c69c6c5 100644 --- a/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp @@ -389,7 +389,7 @@ GC::Ptr Parser::convert_to_keyframes_rule(AtRule const& rule) return {}; } - if (name_token.is(Token::Type::Ident) && (is_css_wide_keyword(name_token.ident()) || name_token.ident().equals_ignoring_ascii_case("none"sv))) { + if (name_token.is(Token::Type::Ident) && (is_css_wide_keyword(name_token.ident()) || name_token.ident().is_one_of_ignoring_ascii_case("none"sv, "default"sv))) { dbgln_if(CSS_PARSER_DEBUG, "CSSParser: @keyframes rule name is invalid: {}; discarding.", name_token.ident()); return {}; } diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/keyframes-name-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/keyframes-name-invalid.txt new file mode 100644 index 00000000000..21946f29fb6 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-animations/parsing/keyframes-name-invalid.txt @@ -0,0 +1,24 @@ +Harness status: OK + +Found 19 tests + +19 Pass +Pass invalid: @keyframes none { } +Pass invalid: @keyframes default { } +Pass invalid: @keyframes initial { } +Pass invalid: @keyframes inherit { } +Pass invalid: @keyframes unset { } +Pass invalid: @keyframes revert { } +Pass invalid: @keyframes revert-layer { } +Pass invalid: @keyframes 12 { } +Pass invalid: @keyframes -12 { } +Pass invalid: @keyframes 12foo { } +Pass invalid: @keyframes foo.bar { } +Pass invalid: @keyframes one two { } +Pass invalid: @keyframes one, two { } +Pass invalid: @keyframes one, initial { } +Pass invalid: @keyframes one, inherit { } +Pass invalid: @keyframes one, unset { } +Pass invalid: @keyframes default, two { } +Pass invalid: @keyframes revert, three { } +Pass invalid: @keyframes revert-layer, four { } \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/keyframes-name-invalid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/keyframes-name-invalid.html new file mode 100644 index 00000000000..f8255d0ead2 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-animations/parsing/keyframes-name-invalid.html @@ -0,0 +1,46 @@ + + + + + CSS Animations: parsing @keyframes name with invalid values + + + + + + + + +
+
+
+ + + \ No newline at end of file