Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: LayoutTests/editing/deleting/delete-inline-br.html

Issue 18799004: Don't insert redundant BR for merging (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-09-05T16:10:37 Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/editing/deleting/delete-inline-br.html
diff --git a/LayoutTests/editing/deleting/delete-inline-br.html b/LayoutTests/editing/deleting/delete-inline-br.html
new file mode 100644
index 0000000000000000000000000000000000000000..3475ef8b36e8698b7869a1e5850b2a46a626edde
--- /dev/null
+++ b/LayoutTests/editing/deleting/delete-inline-br.html
@@ -0,0 +1,36 @@
+<div id="container">
+<p id="description"></p>
+<ol>
+<li>Place the caret at the start of the second line</li>
+<li>Hit Baskspace or Delete to a back-delete</li>
+<li>The two lines should then be merged and the caret should get placed after the text control.</li>
+</ol>
+<div contenteditable="true">
+<span id="sample">text1<input type="text"/><br>text2</span>
+</div>
+</div>
+<div id="console"></div>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script>
+description('Testcase for verifying that the &lt;br&gt; does not get deleted when inlined after some non-textual content.');
+function $(id) { return document.getElementById(id); }
+
+function absoluteCaretBounds(node) {
+ return window.internals ? internals.absoluteCaretBounds(node) : '';
+}
+
+var selection = window.getSelection();
+selection.collapse(('sample'), 2);
+var expectedCaretRect = absoluteCaretBounds(document);
+
+selection.collapse(('sample'), 3);
+document.execCommand("Delete");
+var caretRect = absoluteCaretBounds(document);
+
+shouldBe("caretRect.left", "expectedCaretRect.left");
+shouldBe("caretRect.top", "expectedCaretRect.top");
+
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../../fast/js/resources/js-test-pre.js"></script>

Powered by Google App Engine
This is Rietveld 408576698