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

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

Issue 2887273003: No extra space emission in TextIterator::HandleReplacedElement (Closed)
Patch Set: Fri May 19 00:09:20 PDT 2017 Created 3 years, 7 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 cdbf1ad8321e3bc042e1c959ef09830ca6e89a1a..b5f765cbb5ad0760cd763ee29975d0df08b657f1 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -831,22 +831,6 @@ bool TextIteratorAlgorithm<Strategy>::HandleReplacedElement() {
return true;
}
- if (behavior_.CollapseTrailingSpace()) {
- if (last_text_node_) {
- String str = last_text_node_->GetLayoutObject()->GetText();
- if (last_text_node_ended_with_collapsed_space_ && offset_ > 0 &&
- str[offset_ - 1] == ' ') {
- SpliceBuffer(kSpaceCharacter, Strategy::Parent(*last_text_node_),
- last_text_node_, 1, 1);
- return false;
- }
- }
- } else if (last_text_node_ended_with_collapsed_space_) {
- SpliceBuffer(kSpaceCharacter, Strategy::Parent(*last_text_node_),
- last_text_node_, 1, 1);
- return false;
- }
-
if (EntersTextControls() && layout_object->IsTextControl()) {
// The shadow tree should be already visited.
return true;

Powered by Google App Engine
This is Rietveld 408576698