1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-31 01:17:45 +00:00

LibWeb: Sum horizontal margins to calculate space used by floats

This fixes the issue where max margin is used to find offset of
floating box although horizonal margins do not collapse so they need
to be summed instead.
This commit is contained in:
Aliaksandr Kalenik 2023-05-24 18:16:09 +03:00 committed by Andreas Kling
parent 90d8844c77
commit 202b24584f
5 changed files with 83 additions and 49 deletions

View file

@ -0,0 +1,16 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
BlockContainer <body> at (100,8) content-size 200x200 children: not-inline
BlockContainer <div.row> at (50,8) content-size 250x200 children: inline
BlockContainer <div.item> at (50,8) content-size 125x17.46875 floating [BFC] children: inline
line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 1, length: 1, rect: [50,8 9.34375x17.46875]
"a"
TextNode <#text>
TextNode <#text>
BlockContainer <div.item> at (175,8) content-size 125x17.46875 floating [BFC] children: inline
line 0 width: 9.46875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 1, length: 1, rect: [175,8 9.46875x17.46875]
"b"
TextNode <#text>
TextNode <#text>