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

Unified Diff: third_party/WebKit/LayoutTests/editing/inserting/insert-space.html

Issue 2432083003: Add a nbsp at the the end of the text when the next text has a leading space. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/inserting/insert-space.html
diff --git a/third_party/WebKit/LayoutTests/editing/inserting/insert-space.html b/third_party/WebKit/LayoutTests/editing/inserting/insert-space.html
index 778ca82f08f38f3fa85319cb9a5d38a9b8243cae..4c2c31454883fbf9399b36e70af311ada43cf5f9 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/insert-space.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert-space.html
@@ -34,4 +34,17 @@ test(() => assert_selection(
},
'<div contenteditable><p id="para">A\u00A0|</p></div>'),
'Insert a &nbsp; instead of plain space when it is inserted before the empty text node');
+
+test(() => assert_selection(
+ '<div contenteditable><p id="para"></p></div>',
+ selection => {
+ var para = selection.document.getElementById('para');
yosin_UTC9 2016/10/20 01:29:17 nit: Please fix indentation; one more space before
+ para.appendChild(selection.document.createTextNode('A'));
+ para.appendChild(selection.document.createTextNode(' B'));
+ selection.collapse(para.firstChild, 1);
+
+ selection.document.execCommand('insertText', false, ' ');
+ },
+ '<div contenteditable><p id="para">A\u00A0| B</p></div>'),
+ 'Insert a &nbsp; instead of plain space when it is inserted before the text node that has a leading plain space');
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698