8 function setResult(result)
10 var message = "FAIL: Unexpected result: " + result;
14 message = "PASS: Hit the first map in the document.";
15 map1.name = "anothername";
19 message = "PASS: Hit the second map after the first was renamed.";
20 map1.name = "mapname";
24 message = "PASS: Hit the first map after it was renamed back.";
25 map1.parentNode.removeChild(map1);
29 message = "PASS: Hit the second map after the first was removed.";
30 map2.parentNode.insertBefore(map1, map2);
34 message = "PASS: Hit the first map after it was added back.";
35 map2.parentNode.removeChild(map2);
39 message = "PASS: Hit the first map after the second was removed.";
40 map3.parentNode.insertBefore(map2, map3);
44 message = "PASS: Hit the first map after the second was re-added.";
47 document.getElementById("log").textContent += test + ": " + message + "\n";
53 map1 = document.getElementsByTagName("map")[0];
54 map2 = document.getElementsByTagName("map")[1];
55 map3 = document.getElementsByTagName("map")[2];
58 if (!window.eventSender) {
59 document.getElementById("log").textContent = "To run the test manually, click " + numClicks + " times in the image rectangle.\n";
62 layoutTestController.dumpAsText();
63 eventSender.mouseMoveTo(50, 50);
64 for (var click = 0; click < numClicks; ++click) {
65 eventSender.mouseDown();
66 eventSender.mouseUp();
71 <body onload="runTest()">
72 <map name="mapName"><area shape=rect coords="0,0,100,100" onclick="setResult('1')"></map>
73 <map name="mapname"><area shape=rect coords="0,0,100,100" onclick="setResult('2')"></map>
74 <map name="mapname"><area shape=rect coords="0,0,100,100" onclick="setResult('3')"></map>
75 <img src="resources/green.jpg" border=20 width=100 height=100 usemap="#mapname" ismap onclick="setResult('img')">
76 <div>This tests image map behavior when there are multiple maps with the same name.</div>