OLD | NEW |
(Empty) | |
| 1 <!doctype HTML> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 #editable p { |
| 6 font-size: 20px; |
| 7 line-height: 22px; |
| 8 color: red; |
| 9 } |
| 10 </style> |
| 11 <div contenteditable="true" id="editable"> |
| 12 <ul> |
| 13 <li>list item 1</li> |
| 14 <li>list item 2</li> |
| 15 <li>list item 3</li> |
| 16 </ul> |
| 17 <p>Paragraph</p> |
| 18 </div> |
| 19 <script> |
| 20 test(function() { |
| 21 var editor = document.getElementById('editable'); |
| 22 var range = document.createRange(); |
| 23 var selection = window.getSelection(); |
| 24 range.setStart(editor.childNodes[2], 0); |
| 25 range.collapse(true); |
| 26 selection.removeAllRanges(); |
| 27 selection.addRange(range); |
| 28 editor.focus(); |
| 29 document.execCommand('delete'); |
| 30 |
| 31 var htmlPara = document.getElementsByTagName('li')[2].outerHTML; |
| 32 assert_equals(htmlPara, '<li>list item 3Paragraph</li>'); |
| 33 }, 'make a paragraph into a list by backspace'); |
| 34 </script> |
OLD | NEW |