LibWeb: Don't collapse boxes with CSS clear property set

I'm not sure if this is exactly correct, the link to CSS2 spec above
says something that clearance cannot separate boxes, but I'm not sure if
I understood it correctly or if I've done it in the right place.

However, this change fixes our block-and-inline/clearfix.html test again
(was regressed in previous commit).
This commit is contained in:
Karol Kosek 2023-07-11 12:56:26 +02:00 committed by Andreas Kling
commit 5b1aa2d55e
Notes: sideshowbarker 2024-07-17 07:48:42 +09:00

View file

@ -57,6 +57,10 @@ static bool margins_collapse_through(Box const& box, LayoutState& state)
// FIXME: For the purpose of margin collapsing (CSS 2 §8.3.1 Collapsing margins), if the block axis is the
// ratio-dependent axis, it is not considered to have a computed block-size of auto.
// https://www.w3.org/TR/css-sizing-4/#aspect-ratio-margin-collapse
if (box.computed_values().clear() != CSS::Clear::None)
return false;
return state.get(box).border_box_height() == 0;
}