test_bug546995.html (1201B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=546995 5 --> 6 <head> 7 <title>Test for Bug 546995</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=546995">Mozilla Bug 546995</a> 13 <p id="display"></p> 14 <div id="content" style="display: none"> 15 <select id='s'></select> 16 </div> 17 <pre id="test"> 18 <script type="application/javascript"> 19 20 /** Test for Bug 546995 */ 21 22 /* This test in only testing IDL reflection, another one is testing the behavior */ 23 24 function checkAutofocusIDLAttribute(element) 25 { 26 ok('autofocus' in element, "Element has the autofocus IDL attribute"); 27 ok(!element.autofocus, "autofocus default value is false"); 28 element.setAttribute('autofocus', 'autofocus'); 29 ok(element.autofocus, "autofocus should be enabled"); 30 element.removeAttribute('autofocus'); 31 ok(!element.autofocus, "autofocus should be disabled"); 32 } 33 34 // TODO: keygen should be added when correctly implemented, see bug 101019. 35 checkAutofocusIDLAttribute(document.getElementById('s')); 36 37 </script> 38 </pre> 39 </body> 40 </html>