mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 07:09:41 +00:00
LibWeb: Save more details about ASF presence in UnresolvedStyleValue
In the upcoming changes we would have to know specifically whether `var()`, `attr()` or both are included in UnresolvedStyleValue.
This commit is contained in:
parent
d47a22150d
commit
b1efd62ce6
Notes:
github-actions[bot]
2025-07-30 09:07:37 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: b1efd62ce6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5618
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/tcl3
5 changed files with 44 additions and 41 deletions
|
@ -393,7 +393,7 @@ Parser::ParseErrorOr<NonnullRefPtr<CSSStyleValue const>> Parser::parse_css_value
|
|||
|
||||
// FIXME: Stop removing whitespace here. It's less helpful than it seems.
|
||||
Vector<ComponentValue> component_values;
|
||||
bool contains_arbitrary_substitution_function = false;
|
||||
SubstitutionFunctionsPresence substitution_presence;
|
||||
bool const property_accepts_custom_ident = property_accepts_type(property_id, ValueType::CustomIdent);
|
||||
|
||||
while (unprocessed_tokens.has_next_token()) {
|
||||
|
@ -412,12 +412,10 @@ Parser::ParseErrorOr<NonnullRefPtr<CSSStyleValue const>> Parser::parse_css_value
|
|||
return ParseError::IncludesIgnoredVendorPrefix;
|
||||
}
|
||||
|
||||
if (!contains_arbitrary_substitution_function) {
|
||||
if (token.is_function() && token.function().contains_arbitrary_substitution_function())
|
||||
contains_arbitrary_substitution_function = true;
|
||||
else if (token.is_block() && token.block().contains_arbitrary_substitution_function())
|
||||
contains_arbitrary_substitution_function = true;
|
||||
}
|
||||
if (token.is_function())
|
||||
token.function().contains_arbitrary_substitution_function(substitution_presence);
|
||||
else if (token.is_block())
|
||||
token.block().contains_arbitrary_substitution_function(substitution_presence);
|
||||
|
||||
component_values.append(token);
|
||||
}
|
||||
|
@ -428,8 +426,8 @@ Parser::ParseErrorOr<NonnullRefPtr<CSSStyleValue const>> Parser::parse_css_value
|
|||
return parsed_value.release_nonnull();
|
||||
}
|
||||
|
||||
if (property_id == PropertyID::Custom || contains_arbitrary_substitution_function)
|
||||
return UnresolvedStyleValue::create(move(component_values), contains_arbitrary_substitution_function, original_source_text);
|
||||
if (property_id == PropertyID::Custom || substitution_presence.has_any())
|
||||
return UnresolvedStyleValue::create(move(component_values), substitution_presence, original_source_text);
|
||||
|
||||
if (component_values.is_empty())
|
||||
return ParseError::SyntaxError;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue