| 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 ac77e75ae8a58515ef8d1d34c7b81d5f84a3035f..4ea78fdd0590a3ebaaf3f26627f848035d47f538 100644
|
| --- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
|
| @@ -519,14 +519,15 @@ void SelectionController::SelectClosestMisspellingFromHitTestResult(
|
| if (pos.IsNotNull()) {
|
| const PositionInFlatTree& marker_position =
|
| pos.DeepEquivalent().ParentAnchoredEquivalent();
|
| - DocumentMarkerVector markers =
|
| - inner_node->GetDocument().Markers().MarkersInRange(
|
| - EphemeralRange(ToPositionInDOMTree(marker_position)),
|
| + Optional<DocumentMarker*> marker =
|
| + inner_node->GetDocument().Markers().MarkerAtPosition(
|
| + ToPositionInDOMTree(marker_position),
|
| DocumentMarker::MisspellingMarkers());
|
| - if (markers.size() == 1) {
|
| + if (marker.has_value()) {
|
| Node* container_node = marker_position.ComputeContainerNode();
|
| - const PositionInFlatTree start(container_node, markers[0]->StartOffset());
|
| - const PositionInFlatTree end(container_node, markers[0]->EndOffset());
|
| + const PositionInFlatTree start(container_node,
|
| + marker.value()->StartOffset());
|
| + const PositionInFlatTree end(container_node, marker.value()->EndOffset());
|
| new_selection = CreateVisibleSelection(
|
| SelectionInFlatTree::Builder().Collapse(start).Extend(end).Build());
|
| }
|
| @@ -1018,13 +1019,12 @@ static bool HitTestResultIsMisspelled(const HitTestResult& result) {
|
| inner_node->GetLayoutObject()->PositionForPoint(result.LocalPoint()));
|
| if (pos.IsNull())
|
| return false;
|
| + const Position& marker_position =
|
| + pos.DeepEquivalent().ParentAnchoredEquivalent();
|
| return inner_node->GetDocument()
|
| - .Markers()
|
| - .MarkersInRange(
|
| - EphemeralRange(
|
| - pos.DeepEquivalent().ParentAnchoredEquivalent()),
|
| - DocumentMarker::MisspellingMarkers())
|
| - .size() > 0;
|
| + .Markers()
|
| + .MarkerAtPosition(marker_position, DocumentMarker::MisspellingMarkers())
|
| + .has_value();
|
| }
|
|
|
| void SelectionController::SendContextMenuEvent(
|
|
|