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

LibWeb: Get reference height from closest non-anonymous ancestor

Ignore anonymous block boxes when resolving percentage weights that
would refer to them, per the CSS 2 visual formatting model
specification. This fixes the case when we create an anonymous block
between an image which uses a percentage height relative to a parent
which specifies a definite height.

Fixes #19052.
This commit is contained in:
Andi Gallo 2023-05-24 06:57:38 +00:00 committed by Andreas Kling
parent 706a20c4d4
commit 5cec517153
5 changed files with 79 additions and 3 deletions

View file

@ -0,0 +1,26 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x824 [BFC] children: not-inline
BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline
TextNode <#text>
BlockContainer <body> at (8,16) content-size 784x800 children: not-inline
BlockContainer <(anonymous)> at (8,16) content-size 784x0 children: inline
TextNode <#text>
BlockContainer <div.foo> at (8,16) content-size 1280x800 children: not-inline
BlockContainer <(anonymous)> at (8,16) content-size 1280x0 children: inline
TextNode <#text>
BlockContainer <div> at (8,16) content-size 1280x600 children: not-inline
BlockContainer <(anonymous)> at (8,16) content-size 1280x0 children: inline
TextNode <#text>
ImageBox <img> at (88,16) content-size 1200x600 floating children: not-inline
TextNode <#text>
BlockContainer <p> at (8,16) content-size 1280x17.46875 children: inline
line 0 width: 37.21875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
frag 0 from TextNode start: 0, length: 4, rect: [8,16 37.21875x17.46875]
"Test"
TextNode <#text>
BlockContainer <(anonymous)> at (8,49.46875) content-size 1280x0 children: inline
TextNode <#text>
BlockContainer <(anonymous)> at (8,616) content-size 1280x0 children: inline
TextNode <#text>
BlockContainer <(anonymous)> at (8,816) content-size 784x0 children: inline
TextNode <#text>