REGRESSION (r53857): Crash when tabbing to <map>
[WebKit.git] / LayoutTests / fast / events / tab-imagemap.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <link rel="stylesheet" href="../js/resources/js-test-style.css">
5 <script>
6 var successfullyParsed = false;
7 </script>
8 <script src="../js/resources/js-test-pre.js"></script>
9 <body id="body">
10
11 <map name="mymap">
12 <area id="area1" shape="circle" coords="70,84,51" href="1">
13 <area id="area2" shape="rect" coords="25,180,125,280" href="2">
14 <area id="area3" shape="poly" coords="153,106,186,225,340,193,315,81,304,167" href="3">
15 <area id="area4" shape="rect" coords="420,19,478,278" nohref>
16 <area id="area5" shape="circle" coords="220,150,100" href="4">
17 <area id="area6" shape="default" coords="0,0,500,300" href="5">
18 <area id="area7" shape="rect" coords="1, 1, 10, 10" tabindex=-1 href="6">
19 </map>
20
21 <img src="resources/abe.png" width="500" height="300" alt="Image Map" usemap="#mymap" ismap>
22
23
24 <p id="description"></p>
25 <div id="console"></div>
26
27 <script>
28
29     description("This tests that links in a image map are able to be reached through keyboard access and tabbing.");
30
31     eventSender.keyDown('\t');
32     shouldBe("document.activeElement.id", "'area1'");
33
34     eventSender.keyDown('\t');
35     shouldBe("document.activeElement.id", "'area2'");
36
37     eventSender.keyDown('\t');
38     shouldBe("document.activeElement.id", "'area3'");
39
40     // We'll skip over area4 because its nohref
41     eventSender.keyDown('\t');
42     shouldBe("document.activeElement.id", "'area5'");
43
44     eventSender.keyDown('\t');
45     shouldBe("document.activeElement.id", "'area6'");
46
47     // We'll skip over area7 because its tabindex=-1. On the Mac, the wrap around should give 
48     // area1. On GTK, we will go to the body element.
49     eventSender.keyDown('\t');
50     shouldBe("document.activeElement.id == 'area1' || document.activeElement.id == 'body'", "true");
51
52     successfullyParsed = true;
53 </script>
54
55 <script src="../js/resources/js-test-post.js"></script>
56 </body>
57 </html>