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

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

Issue 2857173003: Remove DocumentMarkerController::MarkersInRange() (Closed)
Patch Set: Remove MarkersInRange() Created 3 years, 7 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 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;
}

Powered by Google App Engine
This is Rietveld 408576698