OLD | NEW |
(Empty) | |
| 1 <!doctype HTML> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <div> |
| 5 <ol> |
| 6 <li>First list item |
| 7 <ul> |
| 8 <li id="ul_list_item">Nested list item</li> |
| 9 </ul> |
| 10 </li> |
| 11 </ol> |
| 12 </div> |
| 13 <div> |
| 14 <ul> |
| 15 <li>First list item |
| 16 <ol> |
| 17 <li id="ol_list_item">Nested list item</li> |
| 18 </ol> |
| 19 </li> |
| 20 </ul> |
| 21 </div> |
| 22 <script> |
| 23 test(function() { |
| 24 document.getSelection().removeAllRanges(); |
| 25 var range = document.createRange(); |
| 26 range.selectNode(document.getElementById('ul_list_item')); |
| 27 document.getSelection().addRange(range); |
| 28 |
| 29 assert_equals(document.queryCommandState('insertOrderedList'), false); |
| 30 assert_equals(document.queryCommandState('insertUnorderedList'), true); |
| 31 }, 'run queryCommandState() on the unordered list item'); |
| 32 |
| 33 test(function() { |
| 34 document.getSelection().removeAllRanges(); |
| 35 var range = document.createRange(); |
| 36 range.selectNode(document.getElementById('ol_list_item')); |
| 37 document.getSelection().addRange(range); |
| 38 |
| 39 assert_equals(document.queryCommandState('insertOrderedList'), true); |
| 40 assert_equals(document.queryCommandState('insertUnorderedList'), false); |
| 41 }, 'run queryCommandState() on the ordered list item'); |
| 42 </script> |
OLD | NEW |