1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

LibWeb: Make computed opacity always available

No need to store opacity as Optional<float> as there's always a value
(and the default initial value is 1.)
This commit is contained in:
Andreas Kling 2021-10-19 15:27:40 +02:00
parent 07f15aa550
commit ff45eb7fb1
6 changed files with 14 additions and 20 deletions

View file

@ -501,12 +501,8 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
return NumericStyleValue::create_float(layout_node.computed_values().flex_grow());
case CSS::PropertyID::FlexShrink:
return NumericStyleValue::create_float(layout_node.computed_values().flex_shrink());
case CSS::PropertyID::Opacity: {
auto maybe_opacity = layout_node.computed_values().opacity();
if (!maybe_opacity.has_value())
return {};
return NumericStyleValue::create_float(maybe_opacity.release_value());
}
case CSS::PropertyID::Opacity:
return NumericStyleValue::create_float(layout_node.computed_values().opacity());
case CSS::PropertyID::JustifyContent:
return IdentifierStyleValue::create(to_css_value_id(layout_node.computed_values().justify_content()));
case CSS::PropertyID::BoxShadow: {