Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-style-change.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-style-change.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-style-change.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..224c7bd9cf73b0681b02b5db246228134ae45ac4 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-position-3/position-sticky-style-change.html |
| @@ -0,0 +1,61 @@ |
| +<!DOCTYPE html> |
| +<title>Sticky positioned element should behave correctly when style changes</title> |
| +<link rel="match" href="position-sticky-style-change-ref.html" /> |
| +<link rel="help" href="https://www.w3.org/TR/css-position-3/#sticky-pos" /> |
| +<meta name="assert" content="This test checks that sticky positioned element behaves correctly when style changes." /> |
| + |
| +<style> |
| +html { |
| + overflow: hidden; /* hide scrollbars */ |
| +} |
| + |
| +body { |
| + margin: 0; |
| +} |
| + |
| +.container { |
| + width: 200px; |
| + height: 200px; |
| +} |
| + |
| +.spacer { |
| + height: 2000px; |
| +} |
| + |
| +.box { |
| + width: 100px; |
| + height: 100px; |
| + background-color: green; |
| + top: 50px; |
| +} |
| + |
| +.sticky { |
| + position: sticky; |
| +} |
| + |
| +.relative { |
| + position: relative; |
| +} |
| +</style> |
| + |
| +<script> |
| +window.addEventListener('load', function() { |
| + document.getElementById('scroller1').scrollTop = 100; |
| + document.getElementById('scroller2').scrollTop = 100; |
| + |
| + var sticky1 = document.getElementById('sticky1'); |
| + sticky1.style.position = 'relative'; |
|
flackr
2017/05/31 14:13:47
I thought the thing we wanted to test was that que
yigu
2017/05/31 20:06:24
Done.
|
| + |
| + var sticky2 = document.getElementById('sticky2'); |
| + sticky2.style.position = 'sticky'; |
| +}); |
| +</script> |
| + |
| +<div id="scroller1" class="container"> |
| + <div id="sticky1" class="sticky box"></div> |
| + <div class="spacer"></div> |
| +</div> |
| +<div id="scroller2" class="container"> |
| + <div id="sticky2" class="relative box"></div> |
| + <div class="spacer"></div> |
| +</div> |