OLD | NEW |
(Empty) | |
| 1 <!doctype HTML> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 div { |
| 6 border: 1px solid gray; |
| 7 padding: 10px; |
| 8 line-height: 1.44; |
| 9 } |
| 10 </style> |
| 11 <div contenteditable="true" id="editable"> |
| 12 <p>This is the first paragraph.</p> |
| 13 <p>This is the second.</p> |
| 14 </div> |
| 15 <script> |
| 16 test(function() { |
| 17 var editor = document.getElementById('editable'); |
| 18 var range = document.createRange(); |
| 19 var selection = window.getSelection(); |
| 20 range.setStart(editor.childNodes[2], 0); |
| 21 range.collapse(true); |
| 22 selection.removeAllRanges(); |
| 23 selection.addRange(range); |
| 24 editor.focus(); |
| 25 document.execCommand('delete', null, false); |
| 26 |
| 27 var html_para = document.getElementsByTagName('p')[0].outerHTML; |
| 28 assert_equals(html_para, '<p>This is the first paragraph.This is the second.</
p>'); |
| 29 }, 'merge two paragraphs by backspace'); |
| 30 </script> |
OLD | NEW |