Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..77c5ba34a6a0a4e39fe32e49fec1f4b7c789d52b |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/css/sticky/sticky-top-auto-get-computedstyle.html |
| @@ -0,0 +1,44 @@ |
| +<!DOCTYPE html> |
| +<style> |
| +.box { |
| + position: sticky; |
| +} |
| + |
| +.without-top { |
| + top: auto; |
| +} |
| + |
| +.with-top { |
| + top: 2px; |
|
flackr
2017/05/09 20:26:34
nit: use top: 0px to showcase the original issue t
yigu
2017/05/09 20:43:58
Done.
|
| +} |
| + |
| +.with-bottom { |
| + bottom: 2px; |
| +} |
| + |
| +</style> |
| + |
| +<body> |
| + <div class="box without-top">Sticky, no top</div> |
| + <div class="box with-top">Sticky, with top</div> |
| + <div class="box with-bottom">Sticky, with bottom</div> |
| +</body> |
| + |
| +<!-- top should be auto when not specified for sticky elements. Same for the |
| +other attributes.--> |
| +<script> |
| + if (window.testRunner) |
| + testRunner.dumpAsText(); |
| + |
| + function doTest() { |
| + var boxes = document.getElementsByClassName('box'); |
| + for (var i = 0; i < boxes.length; ++i) { |
| + boxes[i].textContent += ': top = ' + getComputedStyle(boxes[i]).top; |
| + boxes[i].textContent += '; bottom = ' + getComputedStyle(boxes[i]).bottom; |
| + boxes[i].textContent += '; left = ' + getComputedStyle(boxes[i]).left; |
| + boxes[i].textContent += '; right = ' + getComputedStyle(boxes[i]).right; |
| + } |
| + } |
| + |
| + window.addEventListener('load', doTest, false); |
| +</script> |