OLD | NEW |
| (Empty) |
1 <?xml version="1.0" encoding="UTF-8"?> | |
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x
html1/DTD/xhtml1-strict.dtd"> | |
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
4 <head> | |
5 <script> | |
6 | |
7 var test = 1; | |
8 var map1; | |
9 var map2; | |
10 var map3; | |
11 | |
12 function setResult(result) | |
13 { | |
14 var message = "FAIL: Unexpected result: " + result; | |
15 | |
16 if (test === 1) { | |
17 if (result === '1') | |
18 message = "PASS: Hit the first map in the document."; | |
19 map1.name = "anothername"; | |
20 } | |
21 if (test === 2) { | |
22 if (result === '2') | |
23 message = "PASS: Hit the second map after the first was renamed."; | |
24 map1.name = "mapname"; | |
25 } | |
26 if (test === 3) { | |
27 if (result === '1') | |
28 message = "PASS: Hit the first map after it was renamed back."; | |
29 map1.parentNode.removeChild(map1); | |
30 } | |
31 if (test === 4) { | |
32 if (result === '2') | |
33 message = "PASS: Hit the second map after the first was removed."; | |
34 map2.parentNode.insertBefore(map1, map2); | |
35 } | |
36 if (test === 5) { | |
37 if (result === '1') | |
38 message = "PASS: Hit the first map after it was added back."; | |
39 map2.parentNode.removeChild(map2); | |
40 } | |
41 if (test === 6) { | |
42 if (result === '1') | |
43 message = "PASS: Hit the first map after the second was removed."; | |
44 map3.parentNode.insertBefore(map2, map3); | |
45 } | |
46 if (test === 7) { | |
47 if (result === '1') | |
48 message = "PASS: Hit the first map after the second was re-added."; | |
49 } | |
50 | |
51 document.getElementById("log").textContent += test + ": " + message + "\n"; | |
52 ++test; | |
53 } | |
54 | |
55 function runTest() | |
56 { | |
57 map1 = document.getElementsByTagName("map")[1]; | |
58 map2 = document.getElementsByTagName("map")[2]; | |
59 map3 = document.getElementsByTagName("map")[3]; | |
60 | |
61 var numClicks = 7; | |
62 if (!window.eventSender) { | |
63 document.getElementById("log").textContent = "To run the test manually,
click " + numClicks + " times in the image rectangle.\n"; | |
64 return; | |
65 } | |
66 testRunner.dumpAsText(); | |
67 eventSender.mouseMoveTo(50, 50); | |
68 for (var click = 0; numClicks > click; ++click) { | |
69 eventSender.mouseDown(); | |
70 eventSender.mouseUp(); | |
71 } | |
72 } | |
73 | |
74 </script> | |
75 </head> | |
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="mapn
ame" ismap="ismap" onclick="setResult('img')" /> | |
82 <div>This tests image map behavior when there are multiple maps with the same na
me.</div> | |
83 <pre id="log" /> | |
84 </body> | |
85 </html> | |
OLD | NEW |