LibWeb: Store stop-opacity in computed form in ComputedProperties

This commit is contained in:
Callum Law 2025-09-08 00:13:13 +12:00 committed by Tim Ledbetter
commit c045969234
Notes: github-actions[bot] 2025-09-08 10:06:57 +00:00
3 changed files with 2 additions and 6 deletions

View file

@ -813,10 +813,6 @@ RefPtr<StyleValue const> CSSStyleProperties::style_value_for_computed_property(L
return get_computed_value(property_id); return get_computed_value(property_id);
} }
case PropertyID::StopOpacity: {
auto opacity = layout_node.computed_values().stop_opacity();
return NumberStyleValue::create(opacity);
}
case PropertyID::StrokeOpacity: { case PropertyID::StrokeOpacity: {
auto opacity = layout_node.computed_values().stroke_opacity(); auto opacity = layout_node.computed_values().stroke_opacity();
return NumberStyleValue::create(opacity); return NumberStyleValue::create(opacity);

View file

@ -515,8 +515,7 @@ float ComputedProperties::stroke_opacity() const
float ComputedProperties::stop_opacity() const float ComputedProperties::stop_opacity() const
{ {
auto const& value = property(PropertyID::StopOpacity); return property(PropertyID::StopOpacity).as_number().number();
return resolve_opacity_value(value);
} }
FillRule ComputedProperties::fill_rule() const FillRule ComputedProperties::fill_rule() const

View file

@ -3285,6 +3285,7 @@ NonnullRefPtr<StyleValue const> StyleComputer::compute_value_of_property(Propert
return compute_border_or_outline_width(specified_value, get_property_specified_value(PropertyID::OutlineStyle), computation_context); return compute_border_or_outline_width(specified_value, get_property_specified_value(PropertyID::OutlineStyle), computation_context);
case PropertyID::FillOpacity: case PropertyID::FillOpacity:
case PropertyID::Opacity: case PropertyID::Opacity:
case PropertyID::StopOpacity:
return compute_opacity(specified_value, computation_context); return compute_opacity(specified_value, computation_context);
default: default:
// FIXME: We should replace this with a VERIFY_NOT_REACHED() once all properties have their own handling. // FIXME: We should replace this with a VERIFY_NOT_REACHED() once all properties have their own handling.