1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:27:43 +00:00

LibWeb: Make sure CSS::ComputedValues has initial size values

Instead of using Optional<LengthPercentage>, we now use LengthPercentage
for these values. The initial values are all `auto`.

This avoids having to check `has_value()` in a ton of places.
This commit is contained in:
Andreas Kling 2022-07-07 12:36:02 +02:00
parent 734ff422ad
commit cefc931347
9 changed files with 81 additions and 86 deletions

View file

@ -37,8 +37,8 @@ void SVGFormattingContext::run(Box const& box, LayoutMode)
auto& layout_node = static_cast<Layout::Node&>(*(svg_element->layout_node()));
// FIXME: Allow for relative lengths here
geometry_box_state.content_width = layout_node.computed_values().width().value().resolved(layout_node, { 0, CSS::Length::Type::Px }).to_px(layout_node);
geometry_box_state.content_height = layout_node.computed_values().height().value().resolved(layout_node, { 0, CSS::Length::Type::Px }).to_px(layout_node);
geometry_box_state.content_width = layout_node.computed_values().width().resolved(layout_node, { 0, CSS::Length::Type::Px }).to_px(layout_node);
geometry_box_state.content_height = layout_node.computed_values().height().resolved(layout_node, { 0, CSS::Length::Type::Px }).to_px(layout_node);
return IterationDecision::Continue;
}