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

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

Issue 2451613003: Get rid of createVisibleSelection() taking two Position (Closed)
Patch Set: 2016-10-26T11:29:45 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
Index: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index 937bc729b0f3b8cb3b804d80ed4c8b629cc759cb..9e6896ee1309521e2ec3500ae956a7afb640075d 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -612,8 +612,11 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity,
// anything.
} else if (Element* table = tableElementJustBefore(visibleStart)) {
setEndingSelection(createVisibleSelection(
- Position::beforeNode(table), endingSelection().start(),
- TextAffinity::Downstream, endingSelection().isDirectional()));
+ SelectionInDOMTree::Builder()
+ .setBaseAndExtentDeprecated(Position::beforeNode(table),
Xiaocheng 2016/10/26 05:49:18 We can use |setBaseAndExtent| since Position::befo
yosin_UTC9 2016/10/26 07:43:07 Done.
+ endingSelection().start())
+ .setIsDirectional(endingSelection().isDirectional())
+ .build()));
typingAddedToOpenCommand(DeleteKey);
return;
}
@@ -730,9 +733,12 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity,
downstreamEnd.computeOffsetInContainerNode() <=
caretMinOffset(downstreamEnd.computeContainerNode())) {
setEndingSelection(createVisibleSelection(
- endingSelection().end(),
- Position::afterNode(downstreamEnd.computeContainerNode()),
- TextAffinity::Downstream, endingSelection().isDirectional()));
+ SelectionInDOMTree::Builder()
+ .setBaseAndExtentDeprecated(
+ endingSelection().end(),
+ Position::afterNode(downstreamEnd.computeContainerNode()))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build()));
typingAddedToOpenCommand(ForwardDeleteKey);
return;
}

Powered by Google App Engine
This is Rietveld 408576698