blob: 18b11da35e5a9271052c8afc7ba6221a99bf1c7a [file] [log] [blame]
<!DOCTYPE html>
<script>
if (window.internals) {
internals.settings.setCSSStickyPositionEnabled(true);
}
</script>
<html>
<head>
<style>
body {
margin: 0;
width: 2000px;
overflow: hidden; /* hide scrollbars */
}
p {
position: relative;
left: 100px;
}
.group {
position: relative;
width: 500px;
height: 200px;
}
.flex-container {
position: relative;
display: flex;
width: 200px;
height: 180px;
flex-flow: row wrap;
outline: 2px solid black;
}
.box {
width: 100px;
height: 180px;
}
.flex-item {
width: 100px;
height: 180px;
display: flex;
}
.sticky {
position: sticky;
left: 100px;
background-color: green;
}
.indicator {
position: absolute;
top: 0;
left: 0;
background-color: red;
}
</style>
<script>
function doTest()
{
window.scrollTo(100, 0);
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<p>This test checks the behavior of position:sticky with flex box items.
There should be no red.</p>
<div class="group" style="left: 100px">
<div class="indicator box" style="left: 100px;"></div>
<div class="flex-container" style="left: 0px;">
<div class="sticky flex-item"></div>
<div class="flex-item" style="background-color: green;"></div>
</div>
</div>
<div class="group" style="left: 150px">
<div class="indicator box" style="left: 50px;"></div>
<div class="flex-container" style="left: 0px;">
<div class="sticky flex-item"></div>
<div class="flex-item" style="background-color: green;"></div>
</div>
</div>
<div class="group" style="left: 200px">
<div class="indicator box" style="left: 0;"></div>
<div class="flex-container" style="left: 0px;">
<div class="sticky flex-item"></div>
<div class="flex-item" style="background-color: green;"></div>
</div>
</div>
</body>
</html>