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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2650183002: Remove spelling markers when element is not editable (Closed)
Patch Set: Fix issue and add new spellcheck_test Created 3 years, 11 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/spellcheck/SpellChecker.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
index 664da652785132d4723d465ec769d1e66b5916de..152dab55b8d6f8532e4a65e9db924445344654e1 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -802,9 +802,13 @@ void SpellChecker::didEndEditingOnTextField(Element* e) {
m_spellCheckRequester->cancelCheck();
TextControlElement* textControlElement = toTextControlElement(e);
HTMLElement* innerEditor = textControlElement->innerEditorElement();
+ removeSpellingAndGrammarMarkers(*innerEditor);
+}
+
+void SpellChecker::removeSpellingAndGrammarMarkers(HTMLElement& element) {
yosin_UTC9 2017/01/26 04:55:48 Note: We want to make this function to have |const
DocumentMarker::MarkerTypes markerTypes(DocumentMarker::Spelling);
markerTypes.add(DocumentMarker::Grammar);
- for (Node& node : NodeTraversal::inclusiveDescendantsOf(*innerEditor))
+ for (Node& node : NodeTraversal::inclusiveDescendantsOf(element))
Xiaocheng 2017/01/26 05:12:33 This function still removes all markers from the e
yosin_UTC9 2017/01/26 05:44:02 Let me cancel my "lgtm". We need to support follow
Manuel Rego 2017/01/27 12:56:19 True, sorry about that. I was checking only one th
frame().document()->markers().removeMarkers(&node, markerTypes);
}

Powered by Google App Engine
This is Rietveld 408576698