Chromium Code Reviews| 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..de5c7459f6b5198cb8d96adcd1d71bce893f8d3a 100644 |
| --- a/third_party/WebKit/Source/core/editing/SelectionController.cpp |
| +++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp |
| @@ -519,12 +519,11 @@ void SelectionController::SelectClosestMisspellingFromHitTestResult( |
| if (pos.IsNotNull()) { |
| const PositionInFlatTree& marker_position = |
| pos.DeepEquivalent().ParentAnchoredEquivalent(); |
| + Node* container_node = marker_position.ComputeContainerNode(); |
| DocumentMarkerVector markers = |
| - inner_node->GetDocument().Markers().MarkersInRange( |
| - EphemeralRange(ToPositionInDOMTree(marker_position)), |
| - DocumentMarker::MisspellingMarkers()); |
| + inner_node->GetDocument().Markers().MarkersFor( |
| + container_node, DocumentMarker::MisspellingMarkers()); |
| if (markers.size() == 1) { |
|
Xiaocheng
2017/05/09 21:55:15
This can break something if there are multiple mar
rlanday
2017/05/09 22:04:17
This seems like something we should push back to D
yosin_UTC9
2017/05/10 01:46:59
Good catch! MarkesForNode() isn't equivalent to Ma
|
| - Node* container_node = marker_position.ComputeContainerNode(); |
| const PositionInFlatTree start(container_node, markers[0]->StartOffset()); |
| const PositionInFlatTree end(container_node, markers[0]->EndOffset()); |
| new_selection = CreateVisibleSelection( |
| @@ -1018,12 +1017,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(); |
| + Node* container_node = marker_position.ComputeContainerNode(); |
| return inner_node->GetDocument() |
| .Markers() |
| - .MarkersInRange( |
| - EphemeralRange( |
| - pos.DeepEquivalent().ParentAnchoredEquivalent()), |
| - DocumentMarker::MisspellingMarkers()) |
| + .MarkersFor(container_node, DocumentMarker::MisspellingMarkers()) |
| .size() > 0; |
| } |