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

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

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
« 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 d8ed94c3b42987a2debfd40e1e6c6c2c38bcec3c..1c898c525dc5c9c8d5a403062637151d0d85db74 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -736,7 +736,7 @@ void CompositeEditCommand::rebalanceWhitespaceOnTextSubstring(Text* textNode, in
// current text node.
isStartOfParagraph(visibleUpstreamPos) || upstream == 0,
(isEndOfParagraph(visibleDownstreamPos) || (unsigned)downstream == text.length())
yosin_UTC9 2016/07/29 01:15:57 OPTIONAL: I think using local variable |shouldEmit
- && !(textNode->nextSibling() && textNode->nextSibling()->isTextNode()));
+ && !(textNode->nextSibling() && textNode->nextSibling()->isTextNode() && toText(textNode->nextSibling())->data().length() != 0));
if (string != rebalancedString)
replaceTextInNodePreservingMarkers(textNode, upstream, length, rebalancedString);
« 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