From 428db6e766d734c30f0be4f45bda3331935d1526 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Wed, 23 Nov 2022 22:15:24 +0300 Subject: [PATCH] LibWeb: Return max margin box width from greatest_child_width Return max margin box width instead of max border box width from greatest_child_width. This change fixes: https://wpt.live/css/CSS2/margin-padding-clear/margin-008.xht --- Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 2 +- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index bdb25ab897..d1b80175f9 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -768,7 +768,7 @@ float BlockFormattingContext::greatest_child_width(Box const& box) } else { box.for_each_child_of_type([&](Box const& child) { if (!child.is_absolutely_positioned()) - max_width = max(max_width, m_state.get(child).border_box_width()); + max_width = max(max_width, m_state.get(child).margin_box_width()); }); } return max_width; diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 795ab3d6df..54822f3749 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -207,7 +207,7 @@ float FormattingContext::greatest_child_width(Box const& box) } else { box.for_each_child_of_type([&](Box const& child) { if (!child.is_absolutely_positioned()) - max_width = max(max_width, m_state.get(child).border_box_width()); + max_width = max(max_width, m_state.get(child).margin_box_width()); }); } return max_width;