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 || !window.internals) { |
19 debug("This test only works in the test runner."); | 19 debug("This test only works in the test runner and requires window.i
nternals."); |
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.internals) | 26 window.internals.setPageScaleFactor(2); |
27 window.internals.setPageScaleFactor(2); | |
28 | 27 |
29 // Note that with ScrollTopLeftInterop enabled, document.scrollingElemen
t is | 28 // Note that with ScrollTopLeftInterop enabled, document.scrollingElemen
t is |
30 // null because document.body is potentially scrollable (with overflow:h
idden | 29 // null because document.body is potentially scrollable (with overflow:h
idden |
31 // the box can still be scrolled programmatically). | 30 // the box can still be scrolled programmatically). |
32 shouldBe("window.scrollY", "0"); | 31 shouldBe("internals.visualViewportScrollY()", "0"); |
33 | 32 |
34 if (window.eventSender) { | 33 if (window.eventSender) { |
35 eventSender.mouseMoveTo(100, 100); | 34 eventSender.mouseMoveTo(100, 100); |
36 eventSender.mouseScrollBy(0, -5); | 35 eventSender.mouseScrollBy(0, -5); |
37 } | 36 } |
38 | 37 |
39 shouldBe("window.scrollY", "200"); | 38 shouldBe("internals.visualViewportScrollY()", "200"); |
40 })(); | 39 })(); |
41 </script> | 40 </script> |
OLD | NEW |