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

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

Issue 2641803002: Move EditCommand::starting/endingSelection() to CompositeEditCommand (1/2) (Closed)
Patch Set: Created 3 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/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 c20f8bdf795a1cb8d6501b6b67d7cdd5b81d21d5..285830eacb088698b646a4302f72c5de898f230f 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -80,7 +80,10 @@ namespace blink {
using namespace HTMLNames;
CompositeEditCommand::CompositeEditCommand(Document& document)
- : EditCommand(document) {}
+ : EditCommand(document) {
+ setStartingSelection(document.frame()->selection().selection());
+ setEndingVisibleSelection(m_startingSelection);
+}
CompositeEditCommand::~CompositeEditCommand() {
DCHECK(isTopLevelCommand() || !m_undoStep);
@@ -1932,6 +1935,8 @@ Node* CompositeEditCommand::splitTreeToNode(Node* start,
DEFINE_TRACE(CompositeEditCommand) {
visitor->trace(m_commands);
+ visitor->trace(m_startingSelection);
+ visitor->trace(m_endingSelection);
visitor->trace(m_undoStep);
EditCommand::trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698