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()"> | |
|
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.
| |
| 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 { | |
| 27 window.scrollTo(1, 1); | |
| 28 shouldBe('window.scrollY', "1"); | |
| 29 shouldBe('window.scrollX', "1"); | |
| 30 | |
| 31 window.scrollTo(window.NaN, window.NaN); | |
| 32 shouldBe('window.scrollY', "1"); | |
| 33 shouldBe('window.scrollX', "1"); | |
| 34 | |
| 35 window.scrollBy(window.NaN, window.NaN); | |
| 36 shouldBe('window.scrollY', "1"); | |
| 37 shouldBe('window.scrollX', "1"); | |
| 38 | |
| 39 scroller.scrollTop = 1; | |
| 40 shouldBe("scroller.scrollTop", "1"); | |
| 41 scroller.scrollTop = window.NaN; | |
| 42 shouldBe("scroller.scrollTop", "1"); | |
| 43 | |
| 44 scroller.scrollLeft = 1; | |
| 45 shouldBe("scroller.scrollLeft", "1"); | |
| 46 scroller.scrollLeft = window.NaN; | |
| 47 shouldBe("scroller.scrollLeft", "1"); | |
| 48 } | |
| 49 | |
| 50 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.
| |
| 51 { | |
| 52 if (window.eventSender) | |
| 53 scroll(); | |
| 54 } | |
| 55 | |
| 56 </script> | |
| 57 </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.
| |
| OLD | NEW |