Chromium Code Reviews| Index: LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html |
| diff --git a/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html b/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..901283f02d6c11b584b72dfc3e63215e7ebbfa37 |
| --- /dev/null |
| +++ b/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html |
| @@ -0,0 +1,57 @@ |
| +<!DOCTYPE HTML> |
| +<style> |
| +.spacer { |
| + height: 1000px; |
| + width: 1000px; |
| +} |
| + |
| +#scroller { |
| + height: 100px; |
| + width: 100px; |
| + overflow: scroll; |
| +} |
| +</style> |
| + |
| +<body style="width:30000px;height:30000px" onload="runTest()"> |
|
Rick Byers
2014/10/22 13:55:33
nit: omit body tag (put style in CSS and see below
Yufeng Shen (Slow to review)
2014/10/22 17:38:46
Done.
|
| +<div id=scroller> |
| + <div class=spacer></div> |
| +</div> |
| +</body> |
| + |
| +<script src="../../resources/js-test.js"></script> |
| +<script> |
| +description("Verifies that nan scroll position works correctly."); |
| + |
| +function scroll() |
| +{ |
| + window.scrollTo(1, 1); |
| + shouldBe('window.scrollY', "1"); |
| + shouldBe('window.scrollX', "1"); |
| + |
| + window.scrollTo(window.NaN, window.NaN); |
| + shouldBe('window.scrollY', "1"); |
| + shouldBe('window.scrollX', "1"); |
| + |
| + window.scrollBy(window.NaN, window.NaN); |
| + shouldBe('window.scrollY', "1"); |
| + shouldBe('window.scrollX', "1"); |
| + |
| + scroller.scrollTop = 1; |
| + shouldBe("scroller.scrollTop", "1"); |
| + scroller.scrollTop = window.NaN; |
| + shouldBe("scroller.scrollTop", "1"); |
| + |
| + scroller.scrollLeft = 1; |
| + shouldBe("scroller.scrollLeft", "1"); |
| + scroller.scrollLeft = window.NaN; |
| + shouldBe("scroller.scrollLeft", "1"); |
| +} |
| + |
| +function runTest() |
|
Rick Byers
2014/10/22 13:55:33
to avoid needing <body onload=runTest> use just:
o
Yufeng Shen (Slow to review)
2014/10/22 17:38:46
Done.
|
| +{ |
| + if (window.eventSender) |
| + scroll(); |
| +} |
| + |
| +</script> |
| +</html> |
|
Rick Byers
2014/10/22 13:55:33
nit: omit </html> (you have no <html> tag)
Yufeng Shen (Slow to review)
2014/10/22 17:38:46
Done.
|