summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/accessibility/image-map1.html
blob: 842d9151cbbcdaf1d97f28ce5b866935e3580607 (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
<html>
<head>
<script src="../fast/js/resources/js-test-pre.js"></script>
</head>
<script>
    if (window.testRunner)
        testRunner.dumpAsText();
</script>
<body id="body">
    
    <!-- Test image map -->
    <map id="apple" name="imagemap1">
      <area shape="rect" coords="10,10,133,72" href="http://www.apple.com" title="Link1" />
      <area shape="rect" coords="12,74,134,88" href="http://www.apple.com" title="Link2" />
      <area shape="rect" coords="11,91,133,105" href="http://www.apple.com" title="Link3" />
      <area shape="default" nohref="nohref" alt="" />
    </map>

    <img src="resources/cake.png"  border="0" align="left" usemap="#imagemap1" vspace="1">

<p id="description"></p>
<div id="console"></div>
     
    <script>
        description("This tests that you can reach the links within an image map.");

        if (window.accessibilityController) {
            document.getElementById("body").focus();

            var body = accessibilityController.focusedElement;
            shouldBe("body.childAtIndex(0).role", "'AXRole: AXLink'");
            shouldBe("body.childAtIndex(0).title", "'AXTitle: Link1'");

            shouldBe("body.childAtIndex(1).role", "'AXRole: AXLink'");
            shouldBe("body.childAtIndex(1).title", "'AXTitle: Link2'");

            shouldBe("body.childAtIndex(2).role", "'AXRole: AXLink'");
            shouldBe("body.childAtIndex(2).title", "'AXTitle: Link3'");
        }
</script>

</body>
</html>