LibWeb: Absolutize CalculatedSVs in StyleComputer::absolutize_values

This commit is contained in:
Callum Law 2025-08-04 15:53:14 +12:00 committed by Sam Atkins
parent 9db3c66a85
commit a2ceed27e2
Notes: github-actions[bot] 2025-08-06 16:46:20 +00:00
13 changed files with 49 additions and 40 deletions

View file

@ -2661,6 +2661,17 @@ String CalculatedStyleValue::to_string(SerializationMode serialization_mode) con
return serialize_a_math_function(m_calculation, m_context, serialization_mode);
}
ValueComparingNonnullRefPtr<CSSStyleValue const> CalculatedStyleValue::absolutized(CSSPixelRect const& viewport_rect, Length::FontMetrics const& font_metrics, Length::FontMetrics const& root_font_metrics) const
{
Length::ResolutionContext length_resolution_context {
.viewport_rect = viewport_rect,
.font_metrics = font_metrics,
.root_font_metrics = root_font_metrics
};
return CalculatedStyleValue::create(simplify_a_calculation_tree(m_calculation, m_context, { .length_resolution_context = length_resolution_context }), m_resolved_type, m_context);
}
bool CalculatedStyleValue::equals(CSSStyleValue const& other) const
{
if (type() != other.type())