summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/gestures/gesture-tapHighlight-nested-cursor2.html
blob: a16eaea2adb716bb871659171434fc8456acdd8e (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
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
    <script src="../../resources/js-test.js"></script>
    <script src="resources/link-highlight-helper.js"></script>
    <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css">
    <style>
        #outerDiv {
            width: 150px;
        }
        #outerDiv, #outerDiv div {
            padding: 15px;
            border-style: solid;
        }
    </style>
</head>
<body onload="runTest();">
    <div class="opaqueHighlight" id="outerDiv" style="cursor: pointer">
        <div>
            <div style="cursor: pointer">
                <div id="innerDiv"></div>
            </div>
        </div>
    </div>

    <script>
        function runTest() {
            useMockHighlight();

            var clientRect = document.getElementById("innerDiv").getBoundingClientRect();
            x = (clientRect.left + clientRect.right) / 2;
            y = (clientRect.top +  clientRect.bottom) / 2;
            if (window.testRunner) {
                testRunner.dumpAsTextWithPixelResults();
                testRunner.waitUntilDone();
            }

            if (window.eventSender) {
                eventSender.gestureShowPress(x, y);
                window.setTimeout(function() { window.testRunner.notifyDone(); }, 0);
            } else {
                debug("This test requires DumpRenderTree.");
            }
        }
    </script>
</body>
</html>