summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/gestures/gesture-tapHighlight-form-input-text.html
blob: a5a57bd501dbe919f59d5e2b81e4ee755992140e (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
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script src="resources/link-highlight-helper.js"></script>
<style>
html {
    -webkit-tap-highlight-color: rgb(0, 255, 0);
}
.pointer {
    cursor:pointer;
}
input {
    margin:20px;
}
</style>
<body onload="runTest();">
<div style="transform: translateZ(0); position: relative; left: 10px; top: 40px">
    <form>
        <div class="pointer">
            <input id="target" value="Target Input Text">
        </div>
    </form>
</div>
<div style="position: relative; left: 10px; top: 70px">
This test is successful if there are no green rectangles.
</div>
<script>
function runTest() {
    useMockHighlight();

    var clientRect = target.getBoundingClientRect();
    var x = (clientRect.left + clientRect.right) / 2;
    var 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>