mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/CSS: Parse <single-transition-property>
as a <custom-ident>
The specification also treats a transition name of `none` as invalid.
This commit is contained in:
parent
6298ec6be4
commit
5559c3cb4f
Notes:
github-actions[bot]
2025-03-14 07:53:21 +00:00
Author: https://github.com/tcl3
Commit: 5559c3cb4f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3919
Reviewed-by: https://github.com/gmta ✅
2 changed files with 7 additions and 8 deletions
|
@ -3822,15 +3822,15 @@ RefPtr<CSSStyleValue> Parser::parse_transition_value(TokenStream<ComponentValue>
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tokens.next_token().is(Token::Type::Ident)) {
|
if (auto transition_property = parse_custom_ident_value(tokens, { { "none"sv } })) {
|
||||||
if (transition.property_name) {
|
if (transition.property_name) {
|
||||||
dbgln_if(CSS_PARSER_DEBUG, "Transition property has multiple property identifiers");
|
dbgln_if(CSS_PARSER_DEBUG, "Transition property has multiple property identifiers");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ident = tokens.consume_a_token().token().ident();
|
auto custom_ident = transition_property->custom_ident();
|
||||||
if (auto property = property_id_from_string(ident); property.has_value())
|
if (auto property = property_id_from_string(custom_ident); property.has_value())
|
||||||
transition.property_name = CustomIdentStyleValue::create(ident);
|
transition.property_name = CustomIdentStyleValue::create(custom_ident);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,9 @@ Harness status: OK
|
||||||
|
|
||||||
Found 5 tests
|
Found 5 tests
|
||||||
|
|
||||||
3 Pass
|
5 Pass
|
||||||
2 Fail
|
|
||||||
Pass e.style['transition'] = "1s 2s 3s" should not set the property value
|
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'] = "-1s -2s" should not set the property value
|
||||||
Pass e.style['transition'] = "steps(1) steps(2)" 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
|
Pass e.style['transition'] = "none top" should not set the property value
|
||||||
Fail e.style['transition'] = "initial 1s" should not set the property value
|
Pass e.style['transition'] = "initial 1s" should not set the property value
|
Loading…
Add table
Add a link
Reference in a new issue