mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
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.
26 lines
411 B
HTML
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
|