diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index debeddd600..bc744d7f80 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -849,11 +849,15 @@ Gfx::FloatRect EdgeRect::resolved(Layout::Node const& layout_node, Gfx::FloatRec // widths for , and the same as the used value of the width plus the sum of the // horizontal padding and border widths for , such that four 'auto' values result in the // clipping region being the same as the element's border box). + auto left = border_box.left() + (left_edge.is_auto() ? 0 : left_edge.to_px(layout_node)); + auto top = border_box.top() + (top_edge.is_auto() ? 0 : top_edge.to_px(layout_node)); + auto right = border_box.left() + (right_edge.is_auto() ? border_box.width() : right_edge.to_px(layout_node)); + auto bottom = border_box.top() + (bottom_edge.is_auto() ? border_box.height() : bottom_edge.to_px(layout_node)); return Gfx::FloatRect { - left_edge.is_auto() ? 0 : left_edge.to_px(layout_node), - top_edge.is_auto() ? 0 : top_edge.to_px(layout_node), - right_edge.is_auto() ? border_box.width() : right_edge.to_px(layout_node) - left_edge.to_px(layout_node), - bottom_edge.is_auto() ? border_box.height() : bottom_edge.to_px(layout_node) - top_edge.to_px(layout_node) + left, + top, + right - left, + bottom - top }; }