test_bug1323815.html (1147B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1323815 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 1323815</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 <script type="application/javascript"> 12 13 /** Test for Bug 1323815 */ 14 15 SimpleTest.waitForExplicitFinish(); 16 function test() { 17 var n = document.getElementById("number"); 18 var t = document.getElementById("text"); 19 t.focus(); 20 var gotBlur = false; 21 t.onblur = function(e) { 22 try { 23 is(e.relatedTarget.localName, "input"); 24 } catch(ex) { 25 ok(false, "Accessing properties on the relatedTarget shouldn't throw! " + ex); 26 } 27 gotBlur = true; 28 } 29 30 n.focus(); 31 ok(gotBlur); 32 SimpleTest.finish(); 33 } 34 35 SimpleTest.waitForFocus(test); 36 37 </script> 38 </head> 39 <body> 40 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1323815">Mozilla Bug 1323815</a> 41 <p id="display"></p> 42 <div id="content" style="display: none"> 43 44 </div> 45 <pre id="test"> 46 </pre> 47 48 <input type="number" id="number"><input type="text" id="text"> 49 </body> 50 </html>