1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 20:47:45 +00:00

LibWeb: Rewrite calculation of available space between floats

This code now works in terms of *intrusion* by left and right side
floats into a given box whose insides we're trying to layout.

Previously, it worked in terms of space occupied by floats in the root
box of the BFC they participated in. That created a bunch of edge cases
since the code asking about the information wasn't operating in root
coordinate space, but in the coordinate space of some arbitrarily nested
block descendant of the root.

This finally allows horizontal margins in the containing block chain to
affect floats and nested content correctly, and it also allows us to
remove a bogus workaround in InlineFormattingContext.
This commit is contained in:
Andreas Kling 2023-05-16 09:46:45 +02:00
parent 9bd4add734
commit bab6796099
8 changed files with 159 additions and 40 deletions

View file

@ -5,7 +5,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
TextNode <#text>
BlockContainer <div.outer> at (9,9) content-size 300x250 children: inline
line 0 width: 204, height: 16, bottom: 16, baseline: 12.796875
frag 0 from TextNode start: 1, length: 23, rect: [61,9 204x16]
frag 0 from TextNode start: 1, length: 23, rect: [60,9 204x16]
"foo bar baz foo bar baz"
TextNode <#text>
BlockContainer <div.lefty> at (10,10) content-size 50x50 floating [BFC] children: not-inline