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

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

Issue 2191163002: Add   instead of plain space when it is inserted before the empty text node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: 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 5edee77eb90a06b862dc009c889bf46fe45b9c4c..778ca82f08f38f3fa85319cb9a5d38a9b8243cae 100644
--- a/third_party/WebKit/LayoutTests/editing/inserting/insert-space.html
+++ b/third_party/WebKit/LayoutTests/editing/inserting/insert-space.html
@@ -21,4 +21,17 @@ test(() => assert_selection(
},
'<div contenteditable><p id="para">A |B</p></div>'),
'insert a plain space between two inserted text nodes');
+
+test(() => assert_selection(
+ '<div contenteditable><p id="para"></p></div>',
+ selection => {
+ var para = selection.document.getElementById('para');
+ para.appendChild(selection.document.createTextNode('A'));
+ para.appendChild(selection.document.createTextNode(''));
+ selection.collapse(para.firstChild, 1);
+
+ selection.document.execCommand('insertText', false, ' ');
+ },
+ '<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');
</script>

Powered by Google App Engine
This is Rietveld 408576698