1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:27:34 +00:00

LibWeb: Make sure that margins don't collapse across a nested BFC

In order to fix this, I also had to reorganize the code so that we
create an independent formatting context even for block-level boxes
that don't have any children. This accidentally improves a table
layout test as well (for empty tables).
This commit is contained in:
Andreas Kling 2023-05-19 13:48:47 +02:00
parent 9ce7681ff2
commit 411b28fc59
4 changed files with 62 additions and 31 deletions

View file

@ -0,0 +1,6 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x116 [BFC] children: not-inline
BlockContainer <body> at (8,30) content-size 784x100 children: not-inline
BlockContainer <div.not-bfc> at (8,30) content-size 784x20 children: not-inline
BlockContainer <div.bfc> at (8,80) content-size 784x0 [BFC] children: not-inline
BlockContainer <div.not-bfc> at (8,110) content-size 784x20 children: not-inline

View file

@ -1,8 +1,8 @@
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 (8,8) content-size 784x58.40625 children: not-inline
TableWrapper <(anonymous)> at (8,8) content-size 784x0 [BFC] children: not-inline
TableBox <table#empty-table> at (8,8) content-size 784x0 [TFC] children: not-inline
TableWrapper <(anonymous)> at (8,8) content-size 0x0 [BFC] children: not-inline
TableBox <table#empty-table> at (8,8) content-size 0x0 [TFC] children: not-inline
BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline
TextNode <#text>
TextNode <#text>