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

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

Issue 2441573002: Move setNonDirectionalSelectionIfNeeded() to SelectionController from FrameSelection (Closed)
Patch Set: 2016-10-24T15:46:27 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
Index: third_party/WebKit/Source/core/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index 3a48ab82de3309a19d69ceb4cb2d57930e6e3c9d..06d1f9bd12a676168898fb49ea3fb24fd7e7e4e7 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -61,6 +61,7 @@ SelectionController::SelectionController(LocalFrame& frame)
DEFINE_TRACE(SelectionController) {
visitor->trace(m_frame);
+ visitor->trace(m_originalBaseInFlatTree);
}
namespace {
@@ -123,6 +124,15 @@ VisiblePositionInFlatTree visiblePositionOfHitTestResult(
} // namespace
+Document& SelectionController::document() const {
+ DCHECK(m_frame->document());
+ return *m_frame->document();
+}
+
+void SelectionController::documentDetached() {
+ m_originalBaseInFlatTree = VisiblePositionInFlatTree();
+}
+
bool SelectionController::handleMousePressEventSingleClick(
const MouseEventWithHitTestResults& event) {
TRACE_EVENT0("blink",
@@ -332,9 +342,8 @@ void SelectionController::updateSelectionForMouseDrag(
if (selection().granularity() != CharacterGranularity)
newSelection.expandUsingGranularity(selection().granularity());
- selection().setNonDirectionalSelectionIfNeeded(
- newSelection, selection().granularity(),
- FrameSelection::AdjustEndpointsAtBidiBoundary);
+ setNonDirectionalSelectionIfNeeded(newSelection, selection().granularity(),
+ AdjustEndpointsAtBidiBoundary);
}
bool SelectionController::updateSelectionForMouseDownDispatchingSelectStart(
@@ -362,7 +371,8 @@ bool SelectionController::updateSelectionForMouseDownDispatchingSelectStart(
m_selectionState = SelectionState::PlacedCaret;
}
- this->selection().setNonDirectionalSelectionIfNeeded(selection, granularity);
+ setNonDirectionalSelectionIfNeeded(selection, granularity,
+ DoNotAdjustEndpoints);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698