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
This commit is contained in:
Aliaksandr Kalenik 2022-11-23 22:15:24 +03:00 committed by Andreas Kling
parent 16f2904443
commit 428db6e766
Notes: sideshowbarker 2024-07-17 04:11:24 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -768,7 +768,7 @@ float BlockFormattingContext::greatest_child_width(Box const& box)
} else {
box.for_each_child_of_type<Box>([&](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;

View file

@ -207,7 +207,7 @@ float FormattingContext::greatest_child_width(Box const& box)
} else {
box.for_each_child_of_type<Box>([&](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;