summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/gestures/gesture-tapHighlight-2-iframe-scrolled-outer.html
blob: 4063fe08b5d2597a9d1d80ef8c3678ef58b6e5b9 (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
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script src="resources/link-highlight-helper.js"></script>
</head>
<body onLoad="runTest();">
<iframe id="nestingFrame" src="resources/1-nested-frame-noncomposited.html" style="position: relative; left: 10px; top: 10px; width: 450px; height: 150px;"></iframe>
<div style="position: relative; left: 10px; top: 20px; transform: translateZ(0);">
This test is successful if "Target Link" is covered by a green box with square corners,
and the outer frame is partially scrolled.
</div>
<script>
function runTest() {
    useMockHighlight();
    var nestingFrame = document.getElementById('nestingFrame');
    var targetFrame = nestingFrame.contentDocument.getElementById('targetFrame');
    var clientRect = targetFrame.contentDocument.getElementById('targetLink').getBoundingClientRect();
    x = (clientRect.left + clientRect.right) / 2;
    y = (clientRect.top + clientRect.bottom) / 2 + nestingFrame.getBoundingClientRect().top + targetFrame.getBoundingClientRect().top;
    if (window.testRunner) {
        testRunner.dumpAsTextWithPixelResults();
        testRunner.waitUntilDone();
    }

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