diff --git a/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp b/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp index c1355a9d778..adc4d9fa735 100644 --- a/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/RuleParsing.cpp @@ -515,7 +515,9 @@ GC::Ptr Parser::convert_to_keyframes_rule(AtRule const& rule) return {}; } - auto name = name_token.to_string(); + // Store the logical keyframes name instead of the serialized token text so @keyframes "foo" and + // animation-name: "foo" compare on the same value. + auto name = name_token.is(Token::Type::String) ? name_token.string() : name_token.ident(); GC::RootVector> keyframes(realm().heap()); rule.for_each_as_qualified_rule_list([&](auto& qualified_rule) { diff --git a/Tests/LibWeb/Text/expected/css/insert-rule-quoted-keyframes-invalidation.txt b/Tests/LibWeb/Text/expected/css/insert-rule-quoted-keyframes-invalidation.txt new file mode 100644 index 00000000000..0f9a798c241 --- /dev/null +++ b/Tests/LibWeb/Text/expected/css/insert-rule-quoted-keyframes-invalidation.txt @@ -0,0 +1,2 @@ +opacity before keyframes: 1 +opacity after keyframes: 0.25 diff --git a/Tests/LibWeb/Text/input/css/insert-rule-quoted-keyframes-invalidation.html b/Tests/LibWeb/Text/input/css/insert-rule-quoted-keyframes-invalidation.html new file mode 100644 index 00000000000..3c37d573122 --- /dev/null +++ b/Tests/LibWeb/Text/input/css/insert-rule-quoted-keyframes-invalidation.html @@ -0,0 +1,23 @@ + + + +
target
+