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

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

Issue 2972863003: Introduce CreateVisibleSelectionWithGranularity() (Closed)
Patch Set: 2017-07-06T16:26:15 Created 3 years, 5 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/WebSubstringUtil.mm ('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/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 029e5f7c40f442e4ff6f2d412d26bf02dacaf176..2400a5fccb2e230f2ecbbc727ebb83120d2eff9c 100644
--- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -393,7 +393,7 @@ static bool ExecuteInsertElement(LocalFrame& frame, HTMLElement* content) {
static bool ExpandSelectionToGranularity(LocalFrame& frame,
TextGranularity granularity) {
- const VisibleSelection& selection = CreateVisibleSelection(
+ const VisibleSelection& selection = CreateVisibleSelectionWithGranularity(
SelectionInDOMTree::Builder()
.SetBaseAndExtent(frame.Selection()
.ComputeVisibleSelectionInDOMTreeDeprecated()
@@ -401,8 +401,8 @@ static bool ExpandSelectionToGranularity(LocalFrame& frame,
frame.Selection()
.ComputeVisibleSelectionInDOMTreeDeprecated()
.Extent())
- .SetGranularity(granularity)
- .Build());
+ .Build(),
+ granularity);
const EphemeralRange new_range = selection.ToNormalizedEphemeralRange();
if (new_range.IsNull())
return false;
« no previous file with comments | « third_party/WebKit/Source/core/editing/WebSubstringUtil.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698