mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb/CSS: Update CalculatedOr API to use CalculationResolutionContext
To be properly compatible with calc(), the resolved() methods all need: - A length resolution context - To return an Optional, as the calculation might not be resolvable A bonus of this is that we can get rid of the overloads of `resolved()` as they now all behave the same way. A downside is a scattering of `value_or()` wherever these are used. It might be the case that all unresolvable calculations have been rejected before this point, but I'm not confident, and so I'll leave it like this for now.
This commit is contained in:
parent
1d71662f31
commit
385c3d273a
Notes:
github-actions[bot]
2025-01-30 18:33:51 +00:00
Author: https://github.com/AtkinsSJ
Commit: 385c3d273a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3383
11 changed files with 98 additions and 100 deletions
|
@ -154,7 +154,10 @@ void SVGPathPaintable::paint(PaintContext& context, PaintPhase phase) const
|
|||
break;
|
||||
}
|
||||
|
||||
auto miter_limit = graphics_element.stroke_miterlimit().value_or(CSS::InitialValues::stroke_miterlimit()).resolved(layout_node());
|
||||
CSS::CalculationResolutionContext calculation_context {
|
||||
.length_resolution_context = CSS::Length::ResolutionContext::for_layout_node(layout_node()),
|
||||
};
|
||||
auto miter_limit = graphics_element.stroke_miterlimit().value_or(CSS::InitialValues::stroke_miterlimit()).resolved(calculation_context).value_or(0);
|
||||
|
||||
auto stroke_opacity = graphics_element.stroke_opacity().value_or(1);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue