OLD | NEW |
1 <script> | 1 <!DOCTYPE html> |
2 if (window.testRunner) | 2 <script src="../../resources/testharness.js"></script> |
3 testRunner.dumpEditingCallbacks(); | 3 <script src="../../resources/testharnessreport.js"></script> |
4 </script> | |
5 <p>The three items below should be stitched together into one ordered list when
you click the button.</div> | 4 <p>The three items below should be stitched together into one ordered list when
you click the button.</div> |
6 <div contenteditable="true"> | 5 <div id="sample" contenteditable="true"> |
7 <div id="item1">foo</div> | 6 <div id="item1">foo</div> |
8 <div id="item2">bar</div> | 7 <div id="item2">bar</div> |
9 <div id="item3">baz</div> | 8 <div id="item3">baz</div> |
10 </div> | 9 </div> |
| 10 <div id="log"></div> |
11 <script> | 11 <script> |
12 var s = window.getSelection(); | 12 test(function() { |
13 s.collapse(document.getElementById("item1"), 0); | 13 var selection = window.getSelection(); |
14 document.execCommand("InsertOrderedList", false, ""); | 14 selection.collapse(document.getElementById('item1'), 0); |
15 s.collapse(document.getElementById("item2"), 0); | 15 document.execCommand('InsertOrderedList'); |
16 document.execCommand("InsertOrderedList", false, ""); | 16 selection.collapse(document.getElementById('item2'), 0); |
17 s.collapse(document.getElementById("item3"), 0); | 17 document.execCommand('InsertOrderedList'); |
18 document.execCommand("InsertOrderedList", false, ""); | 18 selection.collapse(document.getElementById('item3'), 0); |
| 19 document.execCommand('InsertOrderedList'); |
| 20 |
| 21 var sample = document.getElementById('sample'); |
| 22 assert_equals(sample.innerHTML, '\n<div id="item1"><ol><li>foo<br></li><li>b
ar<br></li><li>baz<br></li></ol></div>\n\n\n'); |
| 23 }); |
19 </script> | 24 </script> |
OLD | NEW |