| Index: third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-top.html
|
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-top.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-top.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3dbce69c05183b73c88a71599f4a9965baa859b3
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-top.html
|
| @@ -0,0 +1,85 @@
|
| +<!DOCTYPE html>
|
| +<title>position:sticky elements should respect the top constraint</title>
|
| +<link rel="match" href="position-sticky-top-ref.html" />
|
| +<link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos" />
|
| +<meta name="assert" content="This test checks that position:sticky elements obey their top anchor after scrolling" />
|
| +
|
| +<style>
|
| +.group {
|
| + display: inline-block;
|
| + position: relative;
|
| + width: 150px;
|
| + height: 300px;
|
| +}
|
| +
|
| +.scroller {
|
| + position: relative;
|
| + width: 100px;
|
| + height: 250px;
|
| + overflow: auto;
|
| +}
|
| +
|
| +.contents {
|
| + height: 1000px;
|
| +}
|
| +
|
| +.padding {
|
| + height: 200px;
|
| +}
|
| +
|
| +.box {
|
| + width: 100px;
|
| + height: 100px;
|
| +}
|
| +
|
| +.indicator {
|
| + background-color: red;
|
| + position: absolute;
|
| + left: 0;
|
| +}
|
| +
|
| +.sticky {
|
| + background-color: green;
|
| + position: sticky;
|
| +}
|
| +</style>
|
| +
|
| +<script>
|
| +window.addEventListener('load', function() {
|
| + for (const scroller of document.querySelectorAll('.scroller')) {
|
| + scroller.scrollTop = 250;
|
| + }
|
| +});
|
| +</script>
|
| +
|
| +<div class="group">
|
| + <div class="scroller">
|
| + <div class="indicator box" style="top: 250px;"></div>
|
| + <div class="contents">
|
| + <div class="padding"></div>
|
| + <div class="sticky box" style="top: 0;"></div>
|
| + </div>
|
| + </div>
|
| +</div>
|
| +
|
| +<div class="group">
|
| + <div class="scroller">
|
| + <div class="indicator box" style="top: 325px;"></div>
|
| + <div class="contents">
|
| + <div class="padding"></div>
|
| + <div class="sticky box" style="top: 75px;"></div>
|
| + </div>
|
| + </div>
|
| +</div>
|
| +
|
| +<div class="group">
|
| + <div class="scroller">
|
| + <div class="indicator box" style="top: 375px;"></div>
|
| + <div class="contents">
|
| + <div class="padding"></div>
|
| + <div class="sticky box" style="top: 125px;"></div>
|
| + </div>
|
| + </div>
|
| +</div>
|
| +
|
| +<div>You should see three green boxes above. No red should be visible.</div>
|
|
|