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

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

Issue 2450603003: Introduce EditCommand::setEndingSelection() taking SelectionInDOMTree (Closed)
Patch Set: 2016-10-25T16:39:38 Created 4 years, 2 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/Source/core/editing/commands/EditCommand.h ('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/EditCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
index cd57cf8f6727118c6a9e96df84baa029f2766171..cd04c02d913e15c8e04649f9a77416b9f80af0b6 100644
--- a/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
@@ -71,6 +71,19 @@ void EditCommand::setStartingSelection(const VisibleSelection& selection) {
}
}
+// TODO(yosin): We will make |SelectionInDOMTree| version of
+// |setEndingSelection()| as primary function instead of wrapper, once
+// |EditCommand| holds other than |VisibleSelection|.
+void EditCommand::setEndingSelection(const SelectionInDOMTree& selection) {
+ // TODO(editing-dev): The use of
+ // updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+ setEndingSelection(createVisibleSelection(selection));
+}
+
+// TODO(yosin): We will make |SelectionInDOMTree| version of
+// |setEndingSelection()| as primary function instead of wrapper.
void EditCommand::setEndingSelection(const VisibleSelection& selection) {
for (EditCommand* command = this; command; command = command->m_parent) {
if (EditCommandComposition* composition = compositionIfPossible(command)) {
@@ -81,15 +94,16 @@ void EditCommand::setEndingSelection(const VisibleSelection& selection) {
}
}
+// TODO(yosin): We will make |SelectionInDOMTree| version of
+// |setEndingSelection()| as primary function instead of wrapper.
void EditCommand::setEndingSelection(const VisiblePosition& position) {
if (position.isNull()) {
- setEndingSelection(VisibleSelection());
+ setEndingSelection(SelectionInDOMTree());
return;
}
- setEndingSelection(
- createVisibleSelection(SelectionInDOMTree::Builder()
- .collapse(position.toPositionWithAffinity())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(position.toPositionWithAffinity())
+ .build());
}
bool EditCommand::isRenderedCharacter(const Position& position) {
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/EditCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698