mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibWeb: Make layout code aware that we create BFC for foreignObject
We were already always doing this, but through an unusual mechanism: SVG layout creates a BFC on the stack when laying out foreignObject subtrees. This change makes the rest of the layout system aware of this, and also allows it to be reflected in layout dumps.
This commit is contained in:
parent
0cf9a4543a
commit
07838016c8
Notes:
github-actions[bot]
2025-07-09 12:38:13 +00:00
Author: https://github.com/awesomekling
Commit: 07838016c8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5369
Reviewed-by: https://github.com/gmta ✅
2 changed files with 5 additions and 1 deletions
|
@ -37,6 +37,10 @@ bool FormattingContext::creates_block_formatting_context(Box const& box)
|
||||||
if (box.is_replaced_box())
|
if (box.is_replaced_box())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// AD-HOC: We create a BFC for SVG foreignObject.
|
||||||
|
if (box.is_svg_foreign_object_box())
|
||||||
|
return true;
|
||||||
|
|
||||||
// display: table
|
// display: table
|
||||||
if (box.display().is_table_inside()) {
|
if (box.display().is_table_inside()) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -3,7 +3,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||||
BlockContainer <body> at (8,8) content-size 784x100 children: inline
|
BlockContainer <body> at (8,8) content-size 784x100 children: inline
|
||||||
frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 100x100] baseline: 100
|
frag 0 from SVGSVGBox start: 0, length: 0, rect: [8,8 100x100] baseline: 100
|
||||||
SVGSVGBox <svg> at (8,8) content-size 100x100 [SVG] children: inline
|
SVGSVGBox <svg> at (8,8) content-size 100x100 [SVG] children: inline
|
||||||
SVGForeignObjectBox <foreignObject> at (8,8) content-size 100x100 children: not-inline
|
SVGForeignObjectBox <foreignObject> at (8,8) content-size 100x100 [BFC] children: not-inline
|
||||||
BlockContainer <div> at (8,8) content-size 100x18 children: inline
|
BlockContainer <div> at (8,8) content-size 100x18 children: inline
|
||||||
frag 0 from TextNode start: 0, length: 3, rect: [8,8 27.15625x18] baseline: 13.796875
|
frag 0 from TextNode start: 0, length: 3, rect: [8,8 27.15625x18] baseline: 13.796875
|
||||||
"foo"
|
"foo"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue