1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/tests/mochitest/general/test_focus_legend_noparent.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +<html> 1.5 +<head> 1.6 +<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.7 +<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"> 1.8 +<script type="text/javascript"> 1.9 + 1.10 +SimpleTest.waitForExplicitFinish(); 1.11 + 1.12 +function runTest() 1.13 +{ 1.14 + window.focus(); 1.15 + var g = document.createElementNS("http://www.w3.org/1999/xhtml", "legend"); 1.16 + document.body.appendChild(g); 1.17 + setTimeout(g.focus.bind(g), 0); 1.18 + setTimeout(done, 10); 1.19 +} 1.20 + 1.21 +function done() 1.22 +{ 1.23 + ok(document.hasFocus(), "document is still focused"); 1.24 + is(document.activeElement, document.body, "document has no focused element") 1.25 + SimpleTest.finish(); 1.26 +} 1.27 + 1.28 +SimpleTest.waitForFocus(runTest); 1.29 +</script> 1.30 +</head> 1.31 + 1.32 +<p id="display"></p> 1.33 +<div id="content" style="display: none"> 1.34 +</div> 1.35 + 1.36 +<body onblur="dump('blurred window!\n')"></body> 1.37 +</html>