Files
ladybird/Tests/LibWeb/Ref/input/abspos-after-inline-static-position.html
Andreas Kling cf3d9c1bae LibWeb: Fix static position of inline-level abspos elements in BFC
When an absolutely positioned element's display was inline-level
before blockification, and its preceding sibling is an anonymous
wrapper with inline children, the element's static position should
be at the same vertical position as that wrapper. This matches where
the element would have been placed if it were still inline.

Previously, the static position was always set to the current block
offset (after the preceding block), which placed the element below
the inline content instead of beside it. This caused absolutely
positioned ::after pseudo-elements (like dropdown chevrons) to appear
on the line below the text instead of at the same vertical position.
2026-03-21 21:42:44 -05:00

26 lines
619 B
HTML

<!DOCTYPE html>
<link rel="match" href="../expected/abspos-after-inline-static-position-ref.html">
<style>
* { margin: 0; padding: 0; }
.container { display: inline-block; }
button {
position: relative;
padding: 10px 30px 10px 10px;
border: 1px solid black;
background: lightblue;
font-size: 15px;
width: 100%;
}
button::after {
content: "v";
position: absolute;
right: 10px;
font-size: 10px;
color: green;
}
</style>
<p>Test passes if the green "v" is to the right of "Menu", not below it.</p>
<div class="container">
<button><span>Menu</span></button>
</div>