1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 15:37:46 +00:00

LibWeb: Skip out-of-flow boxes when wrapping inlines in anonymous block

Out-of-flow boxes (floating and absolutely-positioned elements) were
previously collected and put in the anonymous block wrapper as well, but
this actually made hit testing not able to find them, since they were
breaking expectations about tree structure that hit testing relies on.

After this change, we simply let out-of-flow boxes stay in their
original parent, preserving the author's intended box tree structure.
This commit is contained in:
Andreas Kling 2023-12-10 21:33:03 +01:00
parent 11354dbf9e
commit 6994ea5885
10 changed files with 86 additions and 40 deletions

View file

@ -3,9 +3,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline
TextNode <#text>
BlockContainer <body> at (8,16) content-size 784x17.46875 children: not-inline
ImageBox <img> at (8,16) content-size 200x100 floating children: not-inline
BlockContainer <(anonymous)> at (8,16) content-size 784x0 children: inline
TextNode <#text>
ImageBox <img> at (8,16) content-size 200x100 floating children: not-inline
TextNode <#text>
BlockContainer <p> at (8,16) content-size 784x17.46875 children: inline
line 0 width: 37.21875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
@ -18,9 +18,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x116]
PaintableWithLines (BlockContainer(anonymous)) [0,0 800x0]
PaintableWithLines (BlockContainer<BODY>) [8,16 784x17.46875] overflow: [8,16 784x33.46875]
PaintableWithLines (BlockContainer<BODY>) [8,16 784x17.46875] overflow: [8,16 784x100]
ImagePaintable (ImageBox<IMG>) [8,16 200x100]
PaintableWithLines (BlockContainer(anonymous)) [8,16 784x0]
ImagePaintable (ImageBox<IMG>) [8,16 200x100]
PaintableWithLines (BlockContainer<P>) [8,16 784x17.46875]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer(anonymous)) [8,49.46875 784x0]