From c045969234ec6fd6317fd3852cde0debcc30c0bd Mon Sep 17 00:00:00 2001 From: Callum Law Date: Mon, 8 Sep 2025 00:13:13 +1200 Subject: [PATCH] LibWeb: Store `stop-opacity` in computed form in ComputedProperties --- Libraries/LibWeb/CSS/CSSStyleProperties.cpp | 4 ---- Libraries/LibWeb/CSS/ComputedProperties.cpp | 3 +-- Libraries/LibWeb/CSS/StyleComputer.cpp | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Libraries/LibWeb/CSS/CSSStyleProperties.cpp b/Libraries/LibWeb/CSS/CSSStyleProperties.cpp index 97e83f23b87..3d0a880aa1a 100644 --- a/Libraries/LibWeb/CSS/CSSStyleProperties.cpp +++ b/Libraries/LibWeb/CSS/CSSStyleProperties.cpp @@ -813,10 +813,6 @@ RefPtr CSSStyleProperties::style_value_for_computed_property(L return get_computed_value(property_id); } - case PropertyID::StopOpacity: { - auto opacity = layout_node.computed_values().stop_opacity(); - return NumberStyleValue::create(opacity); - } case PropertyID::StrokeOpacity: { auto opacity = layout_node.computed_values().stroke_opacity(); return NumberStyleValue::create(opacity); diff --git a/Libraries/LibWeb/CSS/ComputedProperties.cpp b/Libraries/LibWeb/CSS/ComputedProperties.cpp index 1afd20f44a1..c83dfe0afb1 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.cpp +++ b/Libraries/LibWeb/CSS/ComputedProperties.cpp @@ -515,8 +515,7 @@ float ComputedProperties::stroke_opacity() const float ComputedProperties::stop_opacity() const { - auto const& value = property(PropertyID::StopOpacity); - return resolve_opacity_value(value); + return property(PropertyID::StopOpacity).as_number().number(); } FillRule ComputedProperties::fill_rule() const diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index ba7b52e1df8..5aee74fcd80 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -3285,6 +3285,7 @@ NonnullRefPtr StyleComputer::compute_value_of_property(Propert return compute_border_or_outline_width(specified_value, get_property_specified_value(PropertyID::OutlineStyle), computation_context); case PropertyID::FillOpacity: case PropertyID::Opacity: + case PropertyID::StopOpacity: return compute_opacity(specified_value, computation_context); default: // FIXME: We should replace this with a VERIFY_NOT_REACHED() once all properties have their own handling.