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

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

Issue 2900773002: Use SetSelection in ExecuteDeleteToMark (Closed)
Patch Set: updated 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
« no previous file with comments | « no previous file | 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/EditorCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
index 847e5eefc2226e0f4a018ff85ae6fc4228edbf9d..88abe2a8ed794bee5acec6e2fce4882369ececb7 100644
--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -811,13 +811,12 @@ static bool ExecuteDeleteToMark(LocalFrame& frame,
const EphemeralRange mark =
frame.GetEditor().Mark().ToNormalizedEphemeralRange();
if (mark.IsNotNull()) {
- bool selected = frame.Selection().SetSelectedRange(
- UnionEphemeralRanges(mark, frame.GetEditor().SelectedRange()),
- TextAffinity::kDownstream, SelectionDirectionalMode::kNonDirectional,
+ frame.Selection().SetSelection(
+ SelectionInDOMTree::Builder()
+ .SetBaseAndExtent(
+ UnionEphemeralRanges(mark, frame.GetEditor().SelectedRange()))
+ .Build(),
FrameSelection::kCloseTyping);
- DCHECK(selected);
- if (!selected)
- return false;
}
frame.GetEditor().PerformDelete();
frame.GetEditor().SetMark(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698