summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/touchadjustment/block-testing.html
blob: f3e079838bc325467430176d97f991de2984d230 (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>
    <title>Touch Adjustment: bug 82044</title>
    <script src="../fast/js/resources/js-test-pre.js"></script>
    <script src="resources/touchadjustment.js"></script>
    <style>
        #sandbox { position: absolute; left: 0px; top: 0px; width: 400px; height: 200px; }
        #div1 { position: absolute; left: 50px; top: 50px; width: 200px; height: 50px;}
        #div2 { position: absolute; left: 50px; top: 100px; width: 200px; height: 50px;}
    </style>
</head>
<body>
    <div id=sandbox>
        <div id=div1 onclick=onClick>
        Some text.
        </div>

        <div id=div2>
        Some text. <a id=a1 href="#1">A link</a>
        </div>
    </div>

    <p id='description'></p>
    <div id='console'></div>

    <script>
        function onClick() {
        }

        function testDirectTouches()
        {
            testTouchPoint(touchPoint(200, 90, 200), document.getElementById('div1'));

        }
        function runTests()
        {
            if (window.testRunner && window.internals && internals.touchNodeAdjustedToBestClickableNode) {
                description('Test touch-adjustment on a block where we also touch the inner text and outside link.');
                testDirectTouches();
                document.getElementById('sandbox').style.display = 'none';
            }
        }
        runTests();
    </script>
</body>
</html>