Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE HTML> | |
| 2 <style> | |
| 3 .spacer { | |
| 4 height: 1000px; | |
| 5 width: 1000px; | |
| 6 } | |
| 7 | |
| 8 #scroller { | |
| 9 height: 100px; | |
| 10 width: 100px; | |
| 11 overflow: scroll; | |
| 12 } | |
| 13 </style> | |
| 14 | |
| 15 <body style="width:30000px;height:30000px" onload="runTest()"> | |
| 16 <div id=scroller> | |
| 17 <div class=spacer></div> | |
| 18 </div> | |
| 19 </body> | |
| 20 | |
| 21 <script src="../../resources/js-test.js"></script> | |
| 22 <script> | |
| 23 description("Verifies that nan scroll position works correctly."); | |
| 24 | |
| 25 function scroll() | |
| 26 { | |
|
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.
| |
| 27 // 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.
| |
| 28 window.scrollTo(window.nan, window.nan); | |
| 29 shouldBe("document.documentElement.scrollTop", "0"); | |
| 30 shouldBe("document.documentElement.scrollLeft", "0"); | |
| 31 | |
| 32 window.scrollBy(window.nan, window.nan); | |
| 33 shouldBe("document.documentElement.scrollTop", "0"); | |
| 34 shouldBe("document.documentElement.scrollLeft", "0"); | |
| 35 | |
| 36 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.
| |
| 37 shouldBe("document.body.scrollTop", "0"); | |
| 38 document.body.scrollLeft = window.nan | |
| 39 shouldBe("document.body.scrollLeft", "0"); | |
| 40 | |
| 41 scroller.scrollTop = window.nan; | |
| 42 shouldBe("scroller.scrollTop", "0"); | |
| 43 scroller.scrollLeft = window.nan; | |
| 44 shouldBe("scroller.scrollLeft", "0"); | |
| 45 } | |
| 46 | |
| 47 function runTest() | |
| 48 { | |
| 49 if (window.eventSender) | |
| 50 scroll(); | |
| 51 } | |
| 52 | |
| 53 </script> | |
| 54 </html> | |
| OLD | NEW |