mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
LibWeb/CSS: Pass Length::ResolutionContext to resolve_integer
The length resolution context might be needed even when resolving an integer value, since it might contain a sign() function with length values inside. This fixes a WPT subtest.
This commit is contained in:
parent
8bec80ac47
commit
1882a2e19b
Notes:
github-actions[bot]
2024-12-04 12:38:56 +00:00
Author: https://github.com/milotier
Commit: 1882a2e19b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2640
Reviewed-by: https://github.com/AtkinsSJ ✅
7 changed files with 75 additions and 17 deletions
|
@ -47,15 +47,15 @@ NonnullRefPtr<CSSStyleValue> FrequencyOrCalculated::create_style_value() const
|
|||
return FrequencyStyleValue::create(value());
|
||||
}
|
||||
|
||||
i64 IntegerOrCalculated::resolve_calculated(NonnullRefPtr<CSSMathValue> const& calculated, Layout::Node const&) const
|
||||
i64 IntegerOrCalculated::resolve_calculated(NonnullRefPtr<CSSMathValue> const& calculated, Layout::Node const& layout_node) const
|
||||
{
|
||||
return calculated->resolve_integer().value();
|
||||
return calculated->resolve_integer(layout_node).value();
|
||||
}
|
||||
|
||||
i64 IntegerOrCalculated::resolved() const
|
||||
i64 IntegerOrCalculated::resolved(Length::ResolutionContext const& context) const
|
||||
{
|
||||
if (is_calculated())
|
||||
return calculated()->resolve_integer().value();
|
||||
return calculated()->resolve_integer(context).value();
|
||||
return value();
|
||||
}
|
||||
|
||||
|
@ -81,9 +81,9 @@ NonnullRefPtr<CSSStyleValue> LengthOrCalculated::create_style_value() const
|
|||
return LengthStyleValue::create(value());
|
||||
}
|
||||
|
||||
double NumberOrCalculated::resolve_calculated(NonnullRefPtr<CSSMathValue> const& calculated, Layout::Node const&) const
|
||||
double NumberOrCalculated::resolve_calculated(NonnullRefPtr<CSSMathValue> const& calculated, Layout::Node const& layout_node) const
|
||||
{
|
||||
return calculated->resolve_number().value();
|
||||
return calculated->resolve_number(layout_node).value();
|
||||
}
|
||||
|
||||
NonnullRefPtr<CSSStyleValue> NumberOrCalculated::create_style_value() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue