test_focus_legend_noparent.html (883B)
1 <html> 2 <head> 3 <script src="/tests/SimpleTest/SimpleTest.js"></script> 4 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> 5 <script type="text/javascript"> 6 7 SimpleTest.waitForExplicitFinish(); 8 SimpleTest.requestFlakyTimeout("untriaged"); 9 SimpleTest.requestFlakyTimeout("untriaged"); 10 11 function runTest() 12 { 13 window.focus(); 14 var g = document.createElementNS("http://www.w3.org/1999/xhtml", "legend"); 15 document.body.appendChild(g); 16 setTimeout(g.focus.bind(g), 0); 17 setTimeout(done, 10); 18 } 19 20 function done() 21 { 22 ok(document.hasFocus(), "document is still focused"); 23 is(document.activeElement, document.body, "document has no focused element") 24 SimpleTest.finish(); 25 } 26 27 SimpleTest.waitForFocus(runTest); 28 </script> 29 </head> 30 31 <p id="display"></p> 32 <div id="content" style="display: none"> 33 </div> 34 35 <body onblur="dump('blurred window!\n')"></body> 36 </html>