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

Unified Diff: LayoutTests/editing/deleting/delete-br-after-image.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-br-after-image.html
diff --git a/LayoutTests/editing/deleting/delete-br-after-image.html b/LayoutTests/editing/deleting/delete-br-after-image.html
new file mode 100644
index 0000000000000000000000000000000000000000..3494639080e61c5ceecad8b63d2f3893c0780873
--- /dev/null
+++ b/LayoutTests/editing/deleting/delete-br-after-image.html
@@ -0,0 +1,26 @@
+<body>
+<div id="container">
+<div contenteditable="true" id="work">
+<span id="sample"><img width="70" height="70" style="background: #DEF"><br>[click here, hold backspace]</span>
+</div>
+</div>
+</div>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script>
+function $(id) { return document.getElementById(id); }
+
+var range = document.createRange();
+range.setStartAfter($('work').querySelector('br'));
+var selection = window.getSelection();
+selection.removeAllRanges();
+selection.addRange(range);
+document.execCommand('Delete');
+shouldBeEqualToString('$("sample").innerHTML', '<img width="70" height="70" style="background: #DEF">[click here, hold backspace]');
+shouldBeEqualToString('selection.type', 'Caret');
+shouldBe('selection.anchorNode', '$("sample")');
+shouldBe('selection.anchorOffset', '1');
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698