mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibWeb: Make computed flex-grow and flex-shrink always available
These values are not allowed to be absent (auto/none/etc) so we don't need to use Optional<float> for them. This simplifies some things.
This commit is contained in:
@@ -497,18 +497,10 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
break;
|
||||
case CSS::PropertyID::FlexGrow: {
|
||||
auto maybe_grow_factor = layout_node.computed_values().flex_grow_factor();
|
||||
if (!maybe_grow_factor.has_value())
|
||||
return {};
|
||||
return NumericStyleValue::create_float(maybe_grow_factor.release_value());
|
||||
}
|
||||
case CSS::PropertyID::FlexShrink: {
|
||||
auto maybe_shrink_factor = layout_node.computed_values().flex_shrink_factor();
|
||||
if (!maybe_shrink_factor.has_value())
|
||||
return {};
|
||||
return NumericStyleValue::create_float(maybe_shrink_factor.release_value());
|
||||
}
|
||||
case CSS::PropertyID::FlexGrow:
|
||||
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())
|
||||
|
||||
Reference in New Issue
Block a user