Files
ladybird/Tests/LibWeb/Layout/input/block-and-inline/bfc-root-auto-height-expands-for-descendants-with-margin-top.html
Andreas Kling 16662ab230 LibWeb: Account for collapsed top margins in BFC root height calculation
By the time we're measuring the height of a BFC root, we've already
collapsed all relevant margins for the root and its descendants.
Given this, we should simply use 0 (relative to the BFC root) as the
lowest block axis coordinate (i.e Y value) for the margin edges.

This fixes a long-standing issue where BFC roots were sometimes not tall
enough to contain their children due to margins.
2025-02-22 18:41:42 +01:00

26 lines
411 B
HTML

<!doctype html><style>
* {
outline: 1px solid black;
}
html {
width: 100px;
}
body {
width: 100px;
height: 100px;
margin-top: 10px;
}
div#pink {
width: 100px;
height: 100px;
margin-top: 100px;
background: pink;
}
div#orange {
margin-top: 200px;
margin-right: 50px;
margin-bottom: 100px;
background: orange;
}
</style><body><div id="pink"><div id="orange">lol