summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/gestures/gesture-tapHighlight-simple-div-boxshadow-fixed-nested.html
blob: 12f8a75e5a980ae4d1c59e1e6db1dd821960ac8c (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
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="resources/link-highlight-helper.js"></script>
<script src="resources/target-div-run-test.js"></script>
<link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css">
</head>
<body onload="runTest();">
<div style="position: absolute; top: 10px; left: 10px; transform: translateZ(0);">
<div class="opaqueHighlight" id="targetDiv" style="position: fixed; left: 50px; top: 50px; width: 50px; height: 50px; box-shadow: 0px 4px 23px 5px rgba(0, 0, 0, 0.2); border-style: solid; border-width: 2px; cursor: Pointer">
<br><center>Target</center><br>
</div>
</div>
<div style="position: absolute; left: 10px; top: 250px; transform: translateZ(0);">
This test is successful if the box labelled "Target" has a green rectangle centered on it.
</div>
<script>
function runTest() {
    useMockHighlight();
    var clientRect = document.getElementById('targetDiv').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>
</script>
</body>
</html>