1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:27:35 +00:00
serenity/Tests/LibWeb/Layout/input/flex/abspos-flex-child-with-auto-height.html
Andreas Kling 50d72f0d8c LibWeb: Handle case where abspos flex child position depends on height
There's a particularly awkward case where the static position of an
abspos child of a flex container is dependent on its height. This can
happen when `align-items: center` is in effect, as we have to adjust
the abspos child's Y position by half of its height.

This patch solves the issue by reordering operations in the abspos
height resolution algorithm, to make sure that height is resolved
before the static position is calculated.
2023-09-03 15:44:47 +02:00

18 lines
350 B
HTML

<!DOCTYPE html><style>
* { outline: black solid 1px; }
body {
position: relative;
display: flex;
align-items: center;
}
.abspos {
position: absolute;
max-height: 100px;
}
.green {
display: block;
width: 100px;
height: 200px;
background: green;
}
</style><body><div class="abspos"><div class="green">