Files
sousa-gecko/testing/web-platform/tests/css/css-position/position-absolute-dynamic-relayout-005.html
T
Ting-Yu Lin 071f7c450f Bug 2042572 - Teach nsCSSFrameConstructor::GetAbsoluteContainingBlock() the concept of IB-split. r=dholbert,layout-reviewers
The bug happens when we reconstruct the abspos element inside the IB-split
block-wrapper where the inline element is an absolute containing block.

In `GetAbsoluteContainingBlock()`, when `absPosCBCandidate` is the
`MozBlockInsideInlineWrapper`, redirect the candidate to the first IB-split
sibling that is the absolute containing block. Otherwise, the function will
continue going up the parent chain until it finds `nsCanvasFrame` (the initial
containing block).

Differential Revision: https://phabricator.services.mozilla.com/D303124
2026-05-28 19:39:16 +00:00

38 lines
1.1 KiB
HTML

<!DOCTYPE html>
<title>CSS Positioned Test: an absolutely positioned element whose containing block is an inline element resolves its percentage width correctly after revealing itself via content-visibility:visible</title>
<link rel="author" title="Ting-Yu Lin" href="mailto:tlin@mozilla.com">
<link rel="author" title="Mozilla" href="https://www.mozilla.org/">
<link rel="help" href="https://drafts.csswg.org/css-position-3/#absolute-cb">
<link rel="help" href="https://drafts.csswg.org/css-contain-2/#content-visibility">
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=2042572">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
#absCB {
position: relative;
}
#abs {
position: absolute;
width: 80%;
background: red;
content-visibility: hidden;
}
#green {
width: 100px;
height: 100px;
background: green;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<span id="absCB">
<div>
<div id="abs"><div id="green"></div></div>
</div>
</span>
<script>
document.documentElement.offsetTop;
abs.style.contentVisibility = "visible";
</script>