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

Unified Diff: third_party/WebKit/Source/core/editing/WebSubstringUtil.mm

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
Index: third_party/WebKit/Source/core/editing/WebSubstringUtil.mm
diff --git a/third_party/WebKit/Source/core/editing/WebSubstringUtil.mm b/third_party/WebKit/Source/core/editing/WebSubstringUtil.mm
index 7584a652ea8c5a6c71f3a094a387f0681cab6990..f60a06c80198b73d84c2a961a250d10782508da4 100644
--- a/third_party/WebKit/Source/core/editing/WebSubstringUtil.mm
+++ b/third_party/WebKit/Source/core/editing/WebSubstringUtil.mm
@@ -169,11 +169,9 @@ NSAttributedString* WebSubstringUtil::AttributedWordAtPoint(
return nil;
// Expand to word under point.
- const VisibleSelection& selection =
- CreateVisibleSelection(SelectionInDOMTree::Builder()
- .SetBaseAndExtent(range)
- .SetGranularity(kWordGranularity)
- .Build());
+ const VisibleSelection& selection = CreateVisibleSelectionWithGranularity(
+ SelectionInDOMTree::Builder().SetBaseAndExtent(range).Build(),
+ kWordGranularity);
const EphemeralRange word_range = selection.ToNormalizedEphemeralRange();
// Convert to NSAttributedString.

Powered by Google App Engine
This is Rietveld 408576698