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