1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
12 function setResult(result)
14 var message = "FAIL: Unexpected result: " + result;
18 message = "PASS: Hit the first map in the document.";
19 map1.name = "anothername";
23 message = "PASS: Hit the second map after the first was renamed.";
24 map1.name = "mapname";
28 message = "PASS: Hit the first map after it was renamed back.";
29 map1.parentNode.removeChild(map1);
33 message = "PASS: Hit the second map after the first was removed.";
34 map2.parentNode.insertBefore(map1, map2);
38 message = "PASS: Hit the first map after it was added back.";
39 map2.parentNode.removeChild(map2);
43 message = "PASS: Hit the first map after the second was removed.";
44 map3.parentNode.insertBefore(map2, map3);
48 message = "PASS: Hit the first map after the second was re-added.";
51 document.getElementById("log").textContent += test + ": " + message + "\n";
57 map1 = document.getElementsByTagName("map")[1];
58 map2 = document.getElementsByTagName("map")[2];
59 map3 = document.getElementsByTagName("map")[3];
62 if (!window.eventSender) {
63 document.getElementById("log").textContent = "To run the test manually, click " + numClicks + " times in the image rectangle.\n";
66 layoutTestController.dumpAsText();
67 eventSender.mouseMoveTo(50, 50);
68 for (var click = 0; numClicks > click; ++click) {
69 eventSender.mouseDown();
70 eventSender.mouseUp();
76 <body onload="runTest()">
77 <map name="mapName"><area shape="rect" coords="0,0,100,100" onclick="setResult('0')" /></map>
78 <map name="mapname"><area shape="rect" coords="0,0,100,100" onclick="setResult('1')" /></map>
79 <map name="mapname"><area shape="rect" coords="0,0,100,100" onclick="setResult('2')" /></map>
80 <map name="mapname"><area shape="rect" coords="0,0,100,100" onclick="setResult('3')" /></map>
81 <img src="resources/green.jpg" border="20" width="100" height="100" usemap="mapname" ismap="ismap" onclick="setResult('img')" />
82 <div>This tests image map behavior when there are multiple maps with the same name.</div>