OLD | NEW |
| 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> |
1 <script> | 5 <script> |
2 if (window.testRunner) { | 6 test(() => assert_selection( |
3 testRunner.dumpEditingCallbacks(); | 7 [ |
4 testRunner.dumpAsText(); | 8 '<div contenteditable>', |
5 } | 9 '<ol>', |
| 10 '<li>|</li>', |
| 11 '<li>foo bar</li>', |
| 12 '</ol>', |
| 13 '</div>', |
| 14 ].join(''), |
| 15 selection => { |
| 16 selection.document.execCommand('selectAll'); |
| 17 selection.document.execCommand('insertOrderedList'); |
| 18 }, |
| 19 [ |
| 20 '<div contenteditable>', |
| 21 // TODO(yosin): We should study why unlistify sets caret before |
| 22 // last character. |
| 23 '^<br>foo ba|r', |
| 24 '</div>', |
| 25 ].join('')), |
| 26 'Unlistify with an empty list item'); |
6 </script> | 27 </script> |
7 <p>This tests de-listing content.</p> | |
8 <div id="div" contenteditable="true"><ol><li></li><li>There should be a single B
R above this line and no OL or LI.</li></ol></div> | |
9 <p id="console"></p> | |
10 | |
11 <script> | |
12 | |
13 function log(message) { | |
14 var console = document.getElementById("console"); | |
15 var text = document.createTextNode(message); | |
16 console.appendChild(text); | |
17 } | |
18 | |
19 var div = document.getElementById("div"); | |
20 var sel = window.getSelection(); | |
21 | |
22 div.focus(); | |
23 document.execCommand("SelectAll"); | |
24 document.execCommand("InsertOrderedList"); | |
25 | |
26 log(div.innerHTML); | |
27 | |
28 </script> | |
OLD | NEW |