mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb/CSS: Simplify calculations after parsing them
If a calculation was simplified down to a single numeric node, then most of the time we can instead return a regular StyleValue, for example `calc(2px + 3px)` would be simplified down to a `5px` LengthStyleValue. This means that parse_calculated_value() can't return a CalculatedStyleValue directly, and its callers all have to handle non-calculated values as well as calculated ones. This simplification is reflected in the new test results. Serialization is not yet correct in all cases but we're closer than we were. :^)
This commit is contained in:
parent
39cefd7abf
commit
ee712bd98f
Notes:
github-actions[bot]
2025-01-30 18:32:52 +00:00
Author: https://github.com/AtkinsSJ
Commit: ee712bd98f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3383
15 changed files with 295 additions and 228 deletions
|
@ -273,7 +273,7 @@ private:
|
|||
};
|
||||
Optional<PropertyAndValue> parse_css_value_for_properties(ReadonlySpan<PropertyID>, TokenStream<ComponentValue>&);
|
||||
RefPtr<CSSStyleValue> parse_builtin_value(TokenStream<ComponentValue>&);
|
||||
RefPtr<CalculatedStyleValue> parse_calculated_value(ComponentValue const&);
|
||||
RefPtr<CSSStyleValue> parse_calculated_value(ComponentValue const&);
|
||||
RefPtr<CustomIdentStyleValue> parse_custom_ident_value(TokenStream<ComponentValue>&, std::initializer_list<StringView> blacklist);
|
||||
// NOTE: Implemented in generated code. (GenerateCSSMathFunctions.cpp)
|
||||
RefPtr<CalculationNode> parse_math_function(Function const&, CalculationContext const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue