LibWeb: Resolve more calculated values in ComputedProperties

We simplify these at style computation time so there is no need to
maintain them as {Number|Length}OrCalculated

Reduces the time spent in `Length::ResolutionContext::for_layout_node`
from 3.3% to 0.4% when loading
https://en.wikipedia.org/wiki/2023_in_American_television
This commit is contained in:
Callum Law 2025-11-09 16:28:32 +13:00 committed by Andreas Kling
parent 201803f601
commit 7a5b948b5b
Notes: github-actions[bot] 2025-11-10 11:13:07 +00:00
8 changed files with 33 additions and 54 deletions

View file

@ -225,7 +225,7 @@ Optional<CSS::StrokeLinejoin> SVGGraphicsElement::stroke_linejoin() const
return layout_node()->computed_values().stroke_linejoin();
}
Optional<CSS::NumberOrCalculated> SVGGraphicsElement::stroke_miterlimit() const
Optional<double> SVGGraphicsElement::stroke_miterlimit() const
{
if (!layout_node())
return {};

View file

@ -44,7 +44,7 @@ public:
CSS::PaintOrderList paint_order() const;
Optional<CSS::StrokeLinecap> stroke_linecap() const;
Optional<CSS::StrokeLinejoin> stroke_linejoin() const;
Optional<CSS::NumberOrCalculated> stroke_miterlimit() const;
Optional<double> stroke_miterlimit() const;
Optional<float> stroke_opacity() const;
Optional<FillRule> fill_rule() const;
Optional<ClipRule> clip_rule() const;