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

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

Issue 2736613003: Get rid of FrameSelection::setSelection() taking VisibleSelection (Closed)
Patch Set: 2017-03-07T13:53:20 rebase Created 3 years, 9 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/FrameSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index aa8803e13031a870b79fd1a59bfbc079d6fe5a6b..8f14f4fca9039121ba87522f9996bdd9cd1e0582 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -307,18 +307,6 @@ void FrameSelection::setSelection(const SelectionInFlatTree& newSelection,
return setSelection(builder.build(), options, align, granularity);
}
-void FrameSelection::setSelection(const VisibleSelection& newSelection,
- HandleVisibility handleVisibility,
- SetSelectionOptions options,
- CursorAlignOnScroll align,
- TextGranularity granularity) {
- setSelection(
- SelectionInDOMTree::Builder(newSelection.asSelection())
- .setIsHandleVisible(handleVisibility == HandleVisibility::Visible)
- .build(),
- options, align, granularity);
-}
-
void FrameSelection::nodeChildrenWillBeRemoved(ContainerNode& container) {
if (!container.inActiveDocument())
return;
@@ -416,7 +404,7 @@ bool FrameSelection::modify(EAlteration alter,
return false;
}
- setSelection(selectionModifier.selection(), HandleVisibility::NotVisible,
+ setSelection(selectionModifier.selection().asSelection(),
CloseTyping | ClearTypingStyle | UserTriggered,
alter == AlterationMove ? CursorAlignOnScroll::Always
: CursorAlignOnScroll::IfNeeded);
@@ -600,7 +588,7 @@ void FrameSelection::selectFrameElementInParentIfFullySelected() {
// setFocusedFrame can dispatch synchronous focus/blur events. The document
// tree might be modified.
if (newSelection.isNonOrphanedCaretOrRange())
- toLocalFrame(parent)->selection().setSelection(newSelection);
+ toLocalFrame(parent)->selection().setSelection(newSelection.asSelection());
}
// Returns a shadow tree node for legacy shadow trees, a child of the
@@ -1113,7 +1101,9 @@ void FrameSelection::moveRangeSelectionExtent(const IntPoint& contentsPoint) {
VisibleSelection newSelection =
granularityStrategy()->updateExtent(contentsPoint, m_frame);
- setSelection(newSelection, HandleVisibility::Visible,
+ setSelection(SelectionInDOMTree::Builder(newSelection.asSelection())
+ .setIsHandleVisible(true)
+ .build(),
FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle |
FrameSelection::DoNotClearStrategy | UserTriggered,
CursorAlignOnScroll::IfNeeded, CharacterGranularity);

Powered by Google App Engine
This is Rietveld 408576698