| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <body> | |
| 3 <div id="log"></div> | |
| 4 <script src="../../../resources/testharness.js"></script> | |
| 5 <script src="../../../resources/testharnessreport.js"></script> | |
| 6 | |
| 7 <fieldset> | |
| 8 <legend id="legend1">Legend</legend> | |
| 9 <input> | |
| 10 </fieldset> | |
| 11 | |
| 12 <fieldset> | |
| 13 <legend id="legend2" tabindex=10>Legend</legend> | |
| 14 <input> | |
| 15 </fieldset> | |
| 16 | |
| 17 <script> | |
| 18 test(function() { | |
| 19 document.getElementById('legend1').focus(); | |
| 20 assert_equals(document.activeElement.tagName, 'INPUT'); | |
| 21 }, 'focus() for non-focusable LEGEND element delegates focus to the first contro
l in the owner FIELDSET.'); | |
| 22 | |
| 23 test(function() { | |
| 24 document.getElementById('legend2').focus(); | |
| 25 assert_equals(document.activeElement.tagName, 'LEGEND'); | |
| 26 }, 'focus() for focusable LEGEND should not delgates focus.'); | |
| 27 </script> | |
| 28 </body> | |
| OLD | NEW |