Chromium Code Reviews| 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..0fd21892d6786233c9e8566cd17cfa0b0c9ffa23 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-top.html |
| @@ -0,0 +1,86 @@ |
| +<!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-x: hidden; |
| + overflow-y: auto; |
| +} |
| + |
| +.contents { |
| + height: 1000px; |
| +} |
| + |
| +.padding { |
| + height: 200px; |
| +} |
| + |
| +.box { |
| + width: 100%; |
| + 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> |
|
flackr
2017/04/07 18:46:51
To test the three conditions (before sticking, dur
smcgruer
2017/04/19 19:11:16
Done. All tests now test each condition which is m
|
| + </div> |
| + </div> |
| +</div> |
| + |
| +<div>You should see three green boxes above. No red should be visible.</div> |