Index: LayoutTests/editing/deleting/merge-paragraph-with-first-letter.html |
diff --git a/LayoutTests/editing/deleting/merge-paragraph-with-first-letter.html b/LayoutTests/editing/deleting/merge-paragraph-with-first-letter.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8c5e35883c8a10871d2675e7492492e4fa836bed |
--- /dev/null |
+++ b/LayoutTests/editing/deleting/merge-paragraph-with-first-letter.html |
@@ -0,0 +1,43 @@ |
+<head> |
+<style> |
+.test:first-letter { |
+ color: red; |
+} |
+</style> |
+</head> |
+<body> |
+<div id="container"> |
+<div id="sample" contenteditable="true"> |
+<p class="test">abcdefgh</p> |
+</div> |
+</div> |
+<script src="../../fast/js/resources/js-test-pre.js"></script> |
+<script> |
+function $(id) { return document.getElementById(id); } |
+$('sample').focus(); |
+ |
+var range = document.createRange(); |
+range.setStart($('sample').querySelector('p.test').firstChild, 4); |
+var selection = window.getSelection(); |
+selection.removeAllRanges(); |
+selection.addRange(range); |
+ |
+debug('Insert newline'); |
+document.execCommand('InsertText', false, '\n'); |
+shouldBeEqualToString('selection.type', 'Caret'); |
+shouldBe('selection.anchorNode', 'document.querySelectorAll("p.test")[1].firstChild'); |
+shouldBe('selection.anchorOffset', '0'); |
+shouldBeEqualToString('selection.anchorNode.textContent', 'efgh'); |
+ |
+debug('Delete newline'); |
+document.execCommand('Delete'); |
+shouldBeEqualToString('selection.type', 'Caret'); |
+shouldBe('selection.anchorNode', 'document.querySelectorAll("p.test")[0].firstChild'); |
+shouldBe('selection.anchorOffset', '4'); |
+shouldBeEqualToString('selection.anchorNode.textContent', 'abcdefgh'); |
+ |
+if (window.testRunner) |
+ $('container').outerHTML = ''; |
+</script> |
+<script src="../../fast/js/resources/js-test-post.js"></script> |
+</body> |