summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/images/imagemap-nested-area.html
blob: 642e4e89879a626404e9d901d23a568f201134a5 (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
<html>
<head>
    <script>
        function pressTabKey()
        {
            if (window.eventSender)
                eventSender.keyDown("\t");
        }

        function test() {
            if (window.testRunner)
                testRunner.dumpAsText();

            var before = document.getElementById("before");
            var area = document.getElementById("area");

            before.focus();
            pressTabKey();

            if (document.activeElement == area)
                res.innerHTML = "Test Passed";
        }
    </script>
</head>

<body onload="test()">
    This tests that pressing Tab focuses areas in an image map even if they're not direct children.

    <div id="res">Test Failed</div>

    <div id="before" tabIndex=0 />

    <div>
        <map name="imagemap">
            <div>
                <area id="area" shape="rect" coords="0,0,128,128" href="#dummy" />
            </div>
        </map>
        <img width="128" height="128" usemap="#imagemap" ismap />
    </div>

    <div id="after" tabIndex=0 />

</body>
</head>
</html>