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

Unified Diff: third_party/WebKit/Source/core/editing/GranularityStrategy.cpp

Issue 2455083003: Reduce usage of VisibleSelection::setBase() and setExtent() (Closed)
Patch Set: 2016-10-31T10:31:10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/SelectionController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/GranularityStrategy.cpp
diff --git a/third_party/WebKit/Source/core/editing/GranularityStrategy.cpp b/third_party/WebKit/Source/core/editing/GranularityStrategy.cpp
index 2b51dcb4ae864b06f008e1d38d382f6621c7c6ef..d6d932089cc42a96387ec97749dbc25b643f65f3 100644
--- a/third_party/WebKit/Source/core/editing/GranularityStrategy.cpp
+++ b/third_party/WebKit/Source/core/editing/GranularityStrategy.cpp
@@ -268,9 +268,11 @@ VisibleSelection DirectionGranularityStrategy::updateExtent(
m_diffExtentPointFromExtentPosition =
extentPoint + IntSize(m_offset, 0) - positionLocation(newSelectionExtent);
- VisibleSelection newSelection = selection;
- newSelection.setExtent(newSelectionExtent);
- return newSelection;
+ return createVisibleSelection(
+ SelectionInDOMTree::Builder(selection.asSelection())
+ .collapse(selection.base())
+ .extend(newSelectionExtent.deepEquivalent())
+ .build());
}
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/SelectionController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698