test_bug109445.xhtml (1461B)
1 <!DOCTYPE HTML> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=109445 5 --> 6 <head> 7 <title>Test for Bug 109445</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=109445">Mozilla Bug 109445</a> 14 <p id="display"> 15 <map name="a"> 16 <area shape="rect" coords="25,25,75,75" href="#x"/> 17 </map> 18 <map id="b"> 19 <area shape="rect" coords="25,25,75,75" href="#y"/> 20 </map> 21 <map name="a"> 22 <area shape="rect" coords="25,25,75,75" href="#FAIL"/> 23 </map> 24 <map id="b"> 25 <area shape="rect" coords="25,25,75,75" href="#FAIL"/> 26 </map> 27 28 <img usemap="#a" src="image.png"/> 29 <img usemap="#b" src="image.png"/> 30 </p> 31 <div id="content" style="display: none"> 32 33 </div> 34 <pre id="test"> 35 <script type="application/javascript"> 36 37 /** Test for Bug 109445 */ 38 SimpleTest.waitForExplicitFinish(); 39 var images = document.getElementsByTagName("img"); 40 var second = false; 41 onhashchange = function() { 42 if (!second) { 43 second = true; 44 is(location.hash, "#x", "First map"); 45 SimpleTest.waitForFocus(() => synthesizeMouse(images[1], 50, 50, {})); 46 } else { 47 is(location.hash, "#y", "Second map"); 48 SimpleTest.finish(); 49 } 50 }; 51 SimpleTest.waitForFocus(() => synthesizeMouse(images[0], 50, 50, {})); 52 </script> 53 </pre> 54 </body> 55 </html>