mirror of
https://github.com/servo/servo.git
synced 2025-07-21 06:13:40 +01:00
149 lines
3.3 KiB
HTML
149 lines
3.3 KiB
HTML
<!DOCTYPE html>
|
|
<title>Nested right-constrained position:sticky elements should render correctly</title>
|
|
<link rel="match" href="position-sticky-nested-right-ref.html" />
|
|
<link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos" />
|
|
<meta name="assert" content="This test checks that nested position:sticky elements with a right constraint render correctly" />
|
|
|
|
<style>
|
|
.group {
|
|
position: relative;
|
|
width: 250px;
|
|
height: 150px;
|
|
}
|
|
|
|
.scroller {
|
|
position: relative;
|
|
width: 200px;
|
|
height: 100px;
|
|
overflow-x: auto;
|
|
overflow-y: hidden;
|
|
}
|
|
|
|
.contents {
|
|
height: 100%;
|
|
width: 500px;
|
|
/* Allow nice formatting of inline divs. Fonts are not used in this test. */
|
|
font-size: 0;
|
|
}
|
|
|
|
.prepadding {
|
|
display: inline-block;
|
|
height: 100%;
|
|
width: 200px;
|
|
}
|
|
|
|
.container {
|
|
display: inline-block;
|
|
height: 100%;
|
|
width: 200px;
|
|
}
|
|
|
|
.filler {
|
|
display: inline-block;
|
|
height: 100%;
|
|
width: 100px;
|
|
}
|
|
|
|
.outerIndicator {
|
|
background-color: red;
|
|
position: absolute;
|
|
top: 0;
|
|
display: inline-block;
|
|
height: 100%;
|
|
width: 100px;
|
|
}
|
|
|
|
.innerIndicator {
|
|
background-color: red;
|
|
position: absolute;
|
|
top: 0;
|
|
display: inline-block;
|
|
height: 100%;
|
|
width: 50px;
|
|
}
|
|
|
|
.outerSticky {
|
|
background-color: green;
|
|
position: sticky;
|
|
right: 25px;
|
|
display: inline-block;
|
|
height: 100%;
|
|
width: 100px;
|
|
}
|
|
|
|
.innerFiller {
|
|
display: inline-block;
|
|
height: 100%;
|
|
width: 50px;
|
|
}
|
|
|
|
.innerSticky {
|
|
background-color: blue;
|
|
position: sticky;
|
|
right: 35px;
|
|
display: inline-block;
|
|
height: 100%;
|
|
width: 50px;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
window.addEventListener('load', function() {
|
|
document.getElementById('scroller1').scrollLeft = 75;
|
|
document.getElementById('scroller2').scrollLeft = 175;
|
|
document.getElementById('scroller3').scrollLeft = 250;
|
|
});
|
|
</script>
|
|
|
|
<div class="group">
|
|
<div id="scroller1" class="scroller">
|
|
<div class="outerIndicator" style="left: 200px;"></div>
|
|
<div class="contents">
|
|
<div class="prepadding"></div>
|
|
<div class="container">
|
|
<div class="filler"></div>
|
|
<div class="outerSticky">
|
|
<div class="innerIndicator" style="left: 0;"></div>
|
|
<div class="innerFiller"></div>
|
|
<div class="innerSticky"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="group">
|
|
<div id="scroller2" class="scroller">
|
|
<div class="outerIndicator" style="left: 250px;"></div>
|
|
<div class="contents">
|
|
<div class="prepadding"></div>
|
|
<div class="container">
|
|
<div class="filler"></div>
|
|
<div class="outerSticky">
|
|
<div class="innerIndicator" style="left: 40px;"></div>
|
|
<div class="innerFiller"></div>
|
|
<div class="innerSticky"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="group">
|
|
<div id="scroller3" class="scroller">
|
|
<div class="outerIndicator" style="left: 300px;"></div>
|
|
<div class="contents">
|
|
<div class="prepadding"></div>
|
|
<div class="container">
|
|
<div class="filler"></div>
|
|
<div class="outerSticky">
|
|
<div class="innerIndicator" style="left: 50px;"></div>
|
|
<div class="innerFiller"></div>
|
|
<div class="innerSticky"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div>You should see three green and three blue boxes above. No red should be visible.</div>
|