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

Unified Diff: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp

Issue 2473633002: Add a nbsp at the the end of the text when the next text has a leading space. (Closed)
Patch Set: Created 4 years, 1 month 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 | « third_party/WebKit/LayoutTests/editing/inserting/insert-space.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
index 2fbed19343f414d28a0291b4e908133f4e3e9581..8b5c0a300a15cbe45f461b1cd20ec2aa61a4b1db 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -870,7 +870,8 @@ void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(Text* textNode,
// See http://crbug.com/310149
const bool nextSiblingIsTextNode =
textNode->nextSibling() && textNode->nextSibling()->isTextNode() &&
- toText(textNode->nextSibling())->data().length();
+ toText(textNode->nextSibling())->data().length() &&
+ toText(textNode->nextSibling())->data()[0] != ' ';
const bool shouldEmitNBSPbeforeEnd =
(isEndOfParagraphDeprecated(visibleDownstreamPos) ||
(unsigned)downstream == text.length()) &&
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/inserting/insert-space.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698