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

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

Issue 1620653002: Pass Only the Pasted Text to Spellchecker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/commands/ReplaceSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index eedb7d56842d1e910fc531a802d8bc6af80c11c4..9c7903ffaf0e6b58a460fcc568c9e12fe32bef2e 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -1380,6 +1380,9 @@ void ReplaceSelectionCommand::completeHTMLReplacement(const Position &lastPositi
return;
}
+ m_startOfInsertedRange = start;
+ m_endOfInsertedRange = end;
+
if (m_selectReplacement)
setEndingSelection(VisibleSelection(start, end, SEL_DEFAULT_AFFINITY, endingSelection().isDirectional()));
else
@@ -1532,6 +1535,9 @@ bool ReplaceSelectionCommand::performTrivialReplace(const ReplacementFragment& f
&& shouldRemoveEndBR(toHTMLBRElement(nodeAfterInsertionPos.get()), createVisiblePosition(positionBeforeNode(nodeAfterInsertionPos.get()))))
removeNodeAndPruneAncestors(nodeAfterInsertionPos.get());
+ m_startOfInsertedRange = start;
+ m_endOfInsertedRange = end;
+
VisibleSelection selectionAfterReplace(m_selectReplacement ? start : end, end);
setEndingSelection(selectionAfterReplace);
@@ -1544,12 +1550,19 @@ bool ReplaceSelectionCommand::isReplaceSelectionCommand() const
return true;
}
+EphemeralRange ReplaceSelectionCommand::insertedRange() const
+{
+ return EphemeralRange(m_startOfInsertedRange, m_endOfInsertedRange);
+}
+
DEFINE_TRACE(ReplaceSelectionCommand)
{
visitor->trace(m_startOfInsertedContent);
visitor->trace(m_endOfInsertedContent);
visitor->trace(m_insertionStyle);
visitor->trace(m_documentFragment);
+ visitor->trace(m_startOfInsertedRange);
+ visitor->trace(m_endOfInsertedRange);
CompositeEditCommand::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698