test_form_attribute-3.html (2042B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=588683 5 --> 6 <head> 7 <title>Test for form attributes 3</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=588683">Mozilla Bug 588683</a> 13 <p id="display"></p> 14 <div id="content"> 15 <form id='f'> 16 <input name='e1'> 17 </form> 18 <form id='f2'> 19 <input name='e2'> 20 <input id='i3' form='f' 21 onfocus="var catched=false; 22 try { e1; } catch(e) { catched=true; } 23 ok(!catched, 'e1 should be in the scope of i3'); 24 catched = false; 25 try { e2; } catch(e) { catched=true; } 26 ok(catched, 'e2 should not be in the scope of i3'); 27 document.getElementById('i4').focus();" 28 > 29 <input id='i4' form='f2' 30 onfocus="var catched=false; 31 try { e2; } catch(e) { catched=true; } 32 ok(!catched, 'e2 should be in the scope of i4'); 33 document.getElementById('i5').focus();" 34 > 35 <input id='i5' 36 onfocus="var catched=false; 37 try { e2; } catch(e) { catched=true; } 38 ok(!catched, 'e2 should be in the scope of i5'); 39 document.getElementById('i6').focus();" 40 > 41 </form> 42 <input id='i6' form='f' 43 onfocus="var catched=false; 44 try { e1; } catch(e) { catched=true; } 45 ok(!catched, 'e1 should be in the scope of i6'); 46 document.getElementById('i7').focus();" 47 > 48 <input id='i7' form='f2' 49 onfocus="var catched=false; 50 try { e2; } catch(e) { catched=true; } 51 ok(!catched, 'e2 should be in the scope of i7'); 52 this.blur(); 53 SimpleTest.finish();" 54 > 55 </div> 56 <pre id="test"> 57 <script type="application/javascript"> 58 59 /** Test for form attributes 3 */ 60 61 SimpleTest.waitForExplicitFinish(); 62 63 document.getElementById('i3').focus(); 64 65 </script> 66 </pre> 67 </body> 68 </html>