summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/events/scroll-in-scaled-page-with-overflow-hidden.html
blob: 030ac16dec70edd2bc66483bd553a823cc2ec3dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<head>
    <style>
        html, body { margin:0; overflow: hidden; }
    </style>
    <script src="../js/resources/js-test-pre.js"></script>
</head>

<div>This tests that a usually overflow: hidden viewport should be scrollable when scaled. Otherwise, you can't get to content
    you would have been able to get to had you not been zoomed it.</div>
<div id="console"></div>

<div style='font-size:40px; height: 1000px;'>
</div>

<script>
    (function() {
        if (!window.layoutTestController) {
            debug("This test only works in the test runner.");
            return;
        }
        
        // Force a layout.
        document.body.offsetLeft;

        if (window.eventSender)
            eventSender.scalePageBy(2, 0, 0);

        shouldBe("window.document.body.scrollTop", "0");

        if (window.eventSender) {
            eventSender.mouseMoveTo(100, 100);
            eventSender.mouseScrollBy(0, -5);
        }

        shouldBe("window.document.body.scrollTop", "100");
    })();
</script>