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

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

Issue 2911723002: [DMC #24] Add SpellingMarker and GrammarMarker (subclasses of DocumentMarker) (Closed)
Patch Set: Remove declaration for DocumentMarker constructor being removed 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 0e9f300e2e332710f2db273a5f143d58ac87bf60..6512225803bfc9d5c2817b8acd221033ec046fb7 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"
@@ -1014,9 +1015,10 @@ String Internals::markerDescriptionForNode(Node* node,
unsigned index,
ExceptionState& exception_state) {
DocumentMarker* marker = MarkerAt(node, marker_type, index, exception_state);
- if (!marker)
+ if (!marker || (marker->GetType() != DocumentMarker::kSpelling &&
+ marker->GetType() != DocumentMarker::kGrammar))
return String();
- return marker->Description();
+ return ToSpellCheckMarker(marker)->Description();
}
static WTF::Optional<TextMatchMarker::MatchStatus> MatchStatusFrom(

Powered by Google App Engine
This is Rietveld 408576698