diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 5de5b8af1b..1e8006930d 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -807,8 +807,9 @@ float BlockFormattingContext::greatest_child_width(Box const& box) max_width = max(max_width, width_here); } } else { - box.for_each_child_of_type([&](auto& child) { - max_width = max(max_width, m_state.get(child).border_box_width()); + 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()); }); } return max_width; diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 8bb1a97bd9..73b457da7a 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -189,8 +189,9 @@ float FormattingContext::greatest_child_width(Box const& box) max_width = max(max_width, line_box.width()); } } else { - box.for_each_child_of_type([&](auto& child) { - max_width = max(max_width, m_state.get(child).border_box_width()); + 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()); }); } return max_width;