Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!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="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>