Files
ladybird/Tests/LibWeb/Layout/expected/block-and-inline/float-clear-simultaneously.txt
Jelle Raaijmakers f340f8682b LibWeb: Do not clear float sides for floating boxes with clear: ..
We used to always clear the side data after encountering a box with
`clear: ..`, but this is not the right thing to do if that same box also
has `float: ..` set. For example, with `clear: right` and `float: left`
it might be that the next box still wants to clear the right side, and
since the previous box is floating it did not push the next box down far
enough to justify clearing the side data at that point.

This changes the logic to only clear the float side if the clearing box
itself is not floating. We also no longer clear the opposite side after
placing a floating box; that doesn't seem to be necessary anymore.

Fixes #4102.
2025-03-27 00:56:56 +00:00

24 lines
1.4 KiB
Plaintext

Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x166 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x150 children: not-inline
BlockContainer <div.a> at (8,8) content-size 784x50 children: not-inline
BlockContainer <(anonymous)> at (8,58) content-size 784x0 children: inline
TextNode <#text>
BlockContainer <div.b> at (742,58) content-size 50x50 floating [BFC] children: not-inline
TextNode <#text>
BlockContainer <div.c> at (8,108) content-size 0x0 floating [BFC] children: not-inline
TextNode <#text>
BlockContainer <div.d> at (8,108) content-size 784x50 children: not-inline
BlockContainer <(anonymous)> at (8,158) content-size 784x0 children: inline
TextNode <#text>
ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x166]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x150]
PaintableWithLines (BlockContainer<DIV>.a) [8,8 784x50]
PaintableWithLines (BlockContainer(anonymous)) [8,58 784x0]
PaintableWithLines (BlockContainer<DIV>.b) [742,58 50x50]
PaintableWithLines (BlockContainer<DIV>.c) [8,108 0x0]
PaintableWithLines (BlockContainer<DIV>.d) [8,108 784x50]
PaintableWithLines (BlockContainer(anonymous)) [8,158 784x0]