test_bug564001.html (1391B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=564001 5 --> 6 <head> 7 <title>Test for Bug 564001</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <script src="/tests/SimpleTest/EventUtils.js"></script> 10 <link rel="stylesheet" href="/tests/SimpleTest/test.css"> 11 </head> 12 <body> 13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=564001">Mozilla Bug 564001</a> 14 <p id="display"><img usemap=#map src=image.png></p> 15 <div id="content" style="display: none"> 16 17 </div> 18 <pre id="test"> 19 <script> 20 /** Test for Bug 564001 */ 21 SimpleTest.waitForExplicitFinish(); 22 23 var wrongArea = document.createElement("area"); 24 wrongArea.shape = "default"; 25 wrongArea.href = "#FAIL"; 26 var wrongMap = document.createElement("map"); 27 wrongMap.name = "map"; 28 wrongMap.appendChild(wrongArea); 29 document.body.appendChild(wrongMap); 30 31 var rightArea = document.createElement("area"); 32 rightArea.shape = "default"; 33 rightArea.href = "#PASS"; 34 var rightMap = document.createElement("map"); 35 rightMap.name = "map"; 36 rightMap.appendChild(rightArea); 37 document.body.insertBefore(rightMap, wrongMap); 38 39 var images = document.getElementsByTagName("img"); 40 onhashchange = function() { 41 is(location.hash, "#PASS", "Should get the first map in tree order."); 42 SimpleTest.finish(); 43 }; 44 SimpleTest.waitForFocus(() => synthesizeMouse(images[0], 50, 50, {})); 45 </script> 46 </pre> 47 </body> 48 </html>