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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2801483002: Add DocumentMarker::MatchStatus enum for text match markers (Closed)
Patch Set: Created 3 years, 8 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/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index df57f797e4dad5e9b2a5a16abc7851e4a9bd0269..08fba9c80d4e0f968b5e374578671ece35694906 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -954,7 +954,7 @@ unsigned Internals::activeMarkerCountForNode(Node* node) {
unsigned activeMarkerCount = 0;
for (const auto& marker : markers) {
- if (marker->activeMatch())
+ if (marker->activeMatch() == DocumentMarker::MatchStatus::Active)
activeMarkerCount++;
}
@@ -1010,8 +1010,9 @@ void Internals::addTextMatchMarker(const Range* range, bool isActive) {
return;
range->ownerDocument().updateStyleAndLayoutIgnorePendingStylesheets();
- range->ownerDocument().markers().addTextMatchMarker(EphemeralRange(range),
- isActive);
+ range->ownerDocument().markers().addTextMatchMarker(
+ EphemeralRange(range), isActive ? DocumentMarker::MatchStatus::Active
+ : DocumentMarker::MatchStatus::Inactive);
// This simulates what the production code does after
// DocumentMarkerController::addTextMatchMarker().
@@ -1052,10 +1053,12 @@ void Internals::addCompositionMarker(const Range* range,
void Internals::setMarkersActive(Node* node,
unsigned startOffset,
unsigned endOffset,
- bool active) {
+ bool isActive) {
DCHECK(node);
- node->document().markers().setMarkersActive(node, startOffset, endOffset,
- active);
+ node->document().markers().setMarkersActive(
+ node, startOffset, endOffset,
+ isActive ? DocumentMarker::MatchStatus::Active
+ : DocumentMarker::MatchStatus::Inactive);
}
void Internals::setMarkedTextMatchesAreHighlighted(Document* document,

Powered by Google App Engine
This is Rietveld 408576698