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

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

Issue 2911723002: [DMC #24] Add SpellingMarker and GrammarMarker (subclasses of DocumentMarker) (Closed)
Patch Set: Add IsSpellCheckMarker() tests 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/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index cdc6f2a23b7d8894c1a4cf2a9d0ff1f9b24bc404..6829be1f8447ec9f0b27c28584da1f167635c161 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -65,6 +65,7 @@
#include "core/editing/iterators/TextIterator.h"
#include "core/editing/markers/DocumentMarker.h"
#include "core/editing/markers/DocumentMarkerController.h"
+#include "core/editing/markers/SpellCheckMarker.h"
#include "core/editing/markers/TextMatchMarker.h"
#include "core/editing/serializers/Serialization.h"
#include "core/editing/spellcheck/IdleSpellCheckCallback.h"
@@ -1010,9 +1011,9 @@ String Internals::markerDescriptionForNode(Node* node,
unsigned index,
ExceptionState& exception_state) {
DocumentMarker* marker = MarkerAt(node, marker_type, index, exception_state);
- if (!marker)
+ if (!marker || !IsSpellCheckMarker(*marker))
return String();
- return marker->Description();
+ return ToSpellCheckMarker(marker)->Description();
}
static WTF::Optional<TextMatchMarker::MatchStatus> MatchStatusFrom(

Powered by Google App Engine
This is Rietveld 408576698