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; |
} |