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..54881f81e50975cd499ae5cdf25bcb49b1198cbb |
| --- /dev/null |
| +++ b/LayoutTests/fast/scrolling/scrolling-apis-nan-scroll-position.html |
| @@ -0,0 +1,54 @@ |
| +<!DOCTYPE HTML> |
| +<style> |
| +.spacer { |
| + height: 1000px; |
| + width: 1000px; |
| +} |
| + |
| +#scroller { |
| + height: 100px; |
| + width: 100px; |
| + overflow: scroll; |
| +} |
| +</style> |
| + |
| +<body style="width:30000px;height:30000px" onload="runTest()"> |
| +<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() |
| +{ |
|
Rick Byers
2014/10/21 22:22:33
you should start by scrolling to some specific pos
Yufeng Shen (Slow to review)
2014/10/21 22:49:31
Done.
|
| + // window.nan is undefined so NaN. |
|
Rick Byers
2014/10/21 22:22:33
technically NaN and undefined are different in JS.
Yufeng Shen (Slow to review)
2014/10/21 22:49:31
window.NaN is used.
|
| + window.scrollTo(window.nan, window.nan); |
| + shouldBe("document.documentElement.scrollTop", "0"); |
| + shouldBe("document.documentElement.scrollLeft", "0"); |
| + |
| + window.scrollBy(window.nan, window.nan); |
| + shouldBe("document.documentElement.scrollTop", "0"); |
| + shouldBe("document.documentElement.scrollLeft", "0"); |
| + |
| + document.body.scrollTop = window.nan; |
|
Rick Byers
2014/10/21 22:22:33
Once you scroll the document these will probably s
Yufeng Shen (Slow to review)
2014/10/21 22:49:31
Done.
|
| + shouldBe("document.body.scrollTop", "0"); |
| + document.body.scrollLeft = window.nan |
| + shouldBe("document.body.scrollLeft", "0"); |
| + |
| + scroller.scrollTop = window.nan; |
| + shouldBe("scroller.scrollTop", "0"); |
| + scroller.scrollLeft = window.nan; |
| + shouldBe("scroller.scrollLeft", "0"); |
| +} |
| + |
| +function runTest() |
| +{ |
| + if (window.eventSender) |
| + scroll(); |
| +} |
| + |
| +</script> |
| +</html> |