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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp

Issue 2280513004: Restore a collapsed trailing space of text used for line break (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/Source/core/editing/iterators/TextIterator.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
index 5cc04a2bce4a99d935bfcbbc1b3fa9d29d1b0319..e395068c312948706f3fac3decb2c1822047a523 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -613,9 +613,8 @@ void TextIteratorAlgorithm<Strategy>::handleTextBox()
subrunEnd = runEnd;
// Restore the collapsed space at the end of text for copy & paste.
// See http://crbug.com/318925
- if (str.endsWith(' ') && subrunEnd == str.length() - 1 && str[subrunEnd - 1] != ' ') {
- Node* nextNode = Strategy::nextSibling(*m_node);
- if (nextNode && isInline(nextNode))
+ if (layoutObject->needToRestoreCollapsedSpace()) {
+ if (str.endsWith(' ') && str[subrunEnd - 1] != ' ')
++subrunEnd;
}
}

Powered by Google App Engine
This is Rietveld 408576698