LibWeb: Implement "The percentage height calculation quirk" in BFC

See https://quirks.spec.whatwg.org/#the-percentage-height-calculation-quirk

Basically, it means that in quirks mode, percentage height needs to be
resolved against nearest ancestor in the containing block chain that
does not have height=auto.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/365
This commit is contained in:
Aliaksandr Kalenik
2024-09-27 21:47:01 +02:00
committed by Andreas Kling
parent 2e5edcf27e
commit 3a5e78780e
3 changed files with 69 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x616 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x600 children: not-inline
BlockContainer <div> at (8,8) content-size 784x600 children: not-inline
ViewportPaintable (Viewport<#document>) [0,0 800x600] overflow: [0,0 800x616]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x616]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x600]
PaintableWithLines (BlockContainer<DIV>) [8,8 784x600]

View File

@@ -0,0 +1,6 @@
<style>
div {
background-color: crimson;
height: 100%;
}
</style><div></div>