test_bug330705-1.html (1231B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=330705 5 --> 6 <head> 7 <title>Test for Bug 330705</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 10 <script> 11 /* variable is true if the element is focused, false otherwise */ 12 var inputFocused = false; 13 </script> 14 </head> 15 <body> 16 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=330705">Mozilla Bug 330705</a> 17 <p id="display"> 18 <input onfocus="inputFocused = true" onblur="inputFocused = false" type="text"> 19 <button></button> 20 </p> 21 <div id="content" style="display: none"> 22 </div> 23 <pre id="test"> 24 <script class="testbody" type="text/javascript"> 25 /** Test for Bug 330705 */ 26 SimpleTest.waitForExplicitFinish(); 27 var isFocused = false; 28 29 function onLoad() { 30 document.getElementsByTagName('input')[0].focus(); 31 document.getElementsByTagName('button')[0].blur(); 32 ok(inputFocused == true, "the input element is still focused after blur() has been called on the unfocused element"); 33 SimpleTest.finish(); 34 } 35 36 addLoadEvent(onLoad); 37 </script> 38 </pre> 39 </body> 40 </html>