Index: third_party/WebKit/LayoutTests/editing/inserting/insert_br_at_tabspan.html |
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert_br_at_tabspan.html b/third_party/WebKit/LayoutTests/editing/inserting/insert_br_at_tabspan.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7907e4b18fe4dff30e489b3c9395c19bdd528a03 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert_br_at_tabspan.html |
@@ -0,0 +1,58 @@ |
+<!doctype html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script src="../assert_selection.js"></script> |
+<div id="log"></div> |
+<script> |
+test(() => assert_selection( |
+ [ |
+ '<div contenteditable>', |
+ 'a|<span class="Apple-tab-span" style="white-space:pre">\t\t\t</span>z', |
+ '</div>', |
+ ].join(''), |
+ selection => { |
+ selection.document.execCommand('insertLineBreak'); |
+ selection.document.execCommand('insertText', false, 'x'); |
+ }, |
+ [ |
+ '<div contenteditable>', |
+ 'a<br>x|<span class="Apple-tab-span" style="white-space:pre">\t\t\t</span>z', |
+ '</div>', |
+ ].join('')), |
+ 'Insert newline and a character before tabspan'); |
+ |
+test(() => assert_selection( |
+ [ |
+ '<div contenteditable>', |
+ 'a<span class="Apple-tab-span" style="white-space:pre">\t|\t\t</span>z', |
+ '</div>', |
+ ].join(''), |
+ selection => { |
+ selection.document.execCommand('insertLineBreak'); |
+ selection.document.execCommand('insertText', false, 'x'); |
+ }, |
+ [ |
+ '<div contenteditable>', |
+ 'a<span class="Apple-tab-span" style="white-space:pre">\t</span><br>', |
+ 'x|<span class="Apple-tab-span" style="white-space:pre">\t\t</span>z', |
+ '</div>', |
+ ].join('')), |
+ 'Insert newline and a character in tabspan'); |
+ |
+test(() => assert_selection( |
+ [ |
+ '<div contenteditable>', |
+ 'a<span class="Apple-tab-span" style="white-space:pre">\t\t\t|</span>z', |
+ '</div>', |
+ ].join(''), |
+ selection => { |
+ selection.document.execCommand('insertLineBreak'); |
+ selection.document.execCommand('insertText', false, 'x'); |
+ }, |
+ [ |
+ '<div contenteditable>', |
+ 'a<span class="Apple-tab-span" style="white-space:pre">\t\t\t</span><br>x|z', |
+ '</div>', |
+ ].join('')), |
+ 'Insert newline and a character after tabspan'); |
+</script> |