Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <style> | 1 <style> |
| 2 html, body { margin:0; overflow: hidden; } | 2 html, body { margin:0; overflow: hidden; } |
| 3 </style> | 3 </style> |
| 4 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
| 5 | 5 |
| 6 <div> | 6 <div> |
| 7 This tests that a usually overflow: hidden viewport should be scrollable when | 7 This tests that a usually overflow: hidden viewport should be scrollable when |
| 8 scaled. Otherwise, you can't get to content you would have been able to get to | 8 scaled. Otherwise, you can't get to content you would have been able to get to |
| 9 had you not been zoomed it. | 9 had you not been zoomed it. |
| 10 </div> | 10 </div> |
| 11 <div id="console"></div> | 11 <div id="console"></div> |
| 12 | 12 |
| 13 <div style='font-size:40px; height: 1000px;'> | 13 <div style='font-size:40px; height: 1000px;'> |
| 14 </div> | 14 </div> |
| 15 | 15 |
| 16 <script> | 16 <script> |
| 17 (function() { | 17 (function() { |
| 18 if (!window.testRunner) { | 18 if (!window.testRunner) { |
| 19 debug("This test only works in the test runner."); | 19 debug("This test only works in the test runner."); |
| 20 return; | 20 return; |
| 21 } | 21 } |
| 22 | 22 |
| 23 // Force a layout. | 23 // Force a layout. |
| 24 document.body.offsetLeft; | 24 document.body.offsetLeft; |
| 25 | 25 |
| 26 if (window.eventSender) | 26 if (window.eventSender) |
| 27 window.eventSender.setPageScaleFactor(2, 0, 0); | 27 window.eventSender.setPageScaleFactor(2, 0, 0); |
| 28 | 28 |
| 29 shouldBe("window.document.body.scrollTop", "0"); | 29 // Note that with ScrollTopLeftInterop enabled, document.scrollingElemen t is |
| 30 // null because body is potentially scrollable (with overflow:hidden the | |
| 31 // box can still be scrolled progamatically). | |
|
tdresser
2015/05/19 13:53:11
progamatically -> programmatically
body -> docume
Rick Byers
2015/05/20 15:10:24
Done.
| |
| 32 shouldBe("window.scrollY", "0"); | |
| 30 | 33 |
| 31 if (window.eventSender) { | 34 if (window.eventSender) { |
| 32 eventSender.mouseMoveTo(100, 100); | 35 eventSender.mouseMoveTo(100, 100); |
| 33 eventSender.mouseScrollBy(0, -5); | 36 eventSender.mouseScrollBy(0, -5); |
| 34 } | 37 } |
| 35 | 38 |
| 36 shouldBe("window.document.body.scrollTop", "200"); | 39 shouldBe("window.scrollY", "200"); |
| 37 })(); | 40 })(); |
| 38 </script> | 41 </script> |
| OLD | NEW |