diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index 2f3b73b40a7..030b10ef298 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -3822,15 +3822,15 @@ RefPtr Parser::parse_transition_value(TokenStream continue; } - if (tokens.next_token().is(Token::Type::Ident)) { + if (auto transition_property = parse_custom_ident_value(tokens, { { "none"sv } })) { if (transition.property_name) { dbgln_if(CSS_PARSER_DEBUG, "Transition property has multiple property identifiers"); return {}; } - auto ident = tokens.consume_a_token().token().ident(); - if (auto property = property_id_from_string(ident); property.has_value()) - transition.property_name = CustomIdentStyleValue::create(ident); + auto custom_ident = transition_property->custom_ident(); + if (auto property = property_id_from_string(custom_ident); property.has_value()) + transition.property_name = CustomIdentStyleValue::create(custom_ident); continue; } diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/parsing/transition-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/parsing/transition-invalid.txt index 92f21699808..15c778a49e2 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/parsing/transition-invalid.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-transitions/parsing/transition-invalid.txt @@ -2,10 +2,9 @@ Harness status: OK Found 5 tests -3 Pass -2 Fail +5 Pass Pass e.style['transition'] = "1s 2s 3s" should not set the property value Pass e.style['transition'] = "-1s -2s" should not set the property value Pass e.style['transition'] = "steps(1) steps(2)" should not set the property value -Fail e.style['transition'] = "none top" should not set the property value -Fail e.style['transition'] = "initial 1s" should not set the property value \ No newline at end of file +Pass e.style['transition'] = "none top" should not set the property value +Pass e.style['transition'] = "initial 1s" should not set the property value \ No newline at end of file