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

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

Issue 2465803002: Get rid of VisibleSelection::expandUsingGranularity() (Closed)
Patch Set: 2016-10-31T17:16:07 Created 4 years, 1 month 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/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 64ac77640607a35767fd2c5f516e8ef1d4e3d089..b23161de87848d099813ca91935e9082cab34473 100644
--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -387,8 +387,12 @@ static bool executeInsertElement(LocalFrame& frame, HTMLElement* content) {
static bool expandSelectionToGranularity(LocalFrame& frame,
TextGranularity granularity) {
- VisibleSelection selection = frame.selection().selection();
- selection.expandUsingGranularity(granularity);
+ const VisibleSelection& selection = createVisibleSelection(
+ SelectionInDOMTree::Builder()
+ .setBaseAndExtent(frame.selection().selection().base(),
+ frame.selection().selection().extent())
+ .setGranularity(granularity)
+ .build());
const EphemeralRange newRange = selection.toNormalizedEphemeralRange();
if (newRange.isNull())
return false;
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp ('k') | third_party/WebKit/Source/web/mac/WebSubstringUtil.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698