dom/tests/mochitest/general/test_focus_legend_noparent.html

branch
TOR_BUG_9701
changeset 8
97036ab72558
equal deleted inserted replaced
-1:000000000000 0:94ea4a43cdc0
1 <html>
2 <head>
3 <script type="text/javascript" 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
9 function runTest()
10 {
11 window.focus();
12 var g = document.createElementNS("http://www.w3.org/1999/xhtml", "legend");
13 document.body.appendChild(g);
14 setTimeout(g.focus.bind(g), 0);
15 setTimeout(done, 10);
16 }
17
18 function done()
19 {
20 ok(document.hasFocus(), "document is still focused");
21 is(document.activeElement, document.body, "document has no focused element")
22 SimpleTest.finish();
23 }
24
25 SimpleTest.waitForFocus(runTest);
26 </script>
27 </head>
28
29 <p id="display"></p>
30 <div id="content" style="display: none">
31 </div>
32
33 <body onblur="dump('blurred window!\n')"></body>
34 </html>

mercurial