blob: f85ac9f2d4cb5412cba67a001d17ca22682d40c5 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>It tests that fixed (auto)positioned element is placed properly when the parent element is sticky positioned.</title>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
</script>
</head>
<body>
<div style="position: sticky; left: 50px; width: 20px; height: 20px; border: 1px solid green;">
<div class=fixed style="width: 20px; height: 20px; background-color: green;"></div>
</div>
<div style="position: sticky; left: 50px; width: 20px; height: 20px; margin: 5px; border: 1px solid green;">
<div class=fixed style="width: 20px; height: 20px; background-color: green;"></div>
</div>
<script>
setTimeout(function() {
var elements = document.getElementsByClassName("fixed");
for (var i = 0; i < elements.length; ++i)
elements[i].style.position = "fixed";
if (window.testRunner)
testRunner.notifyDone();
}, 0);
</script>
</body>
</html>