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

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

Issue 2669213002: Remove spelling markers in disabled and readonly form elements
Patch Set: Using idle task to remove the markers Created 3 years, 10 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 25f60f163f27973c6d1c8a2585a635c2d5b08483..6dad143c56791351bd45c067e9bfcbaeeed655ab 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -780,21 +780,10 @@ void SpellChecker::didEndEditingOnTextField(Element* e) {
m_spellCheckRequester->cancelCheck();
TextControlElement* textControlElement = toTextControlElement(e);
HTMLElement* innerEditor = textControlElement->innerEditorElement();
- removeSpellingAndGrammarMarkers(*innerEditor);
-}
-
-void SpellChecker::removeSpellingAndGrammarMarkers(const HTMLElement& element,
- ElementsType elementsType) {
- // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
- // needs to be audited. See http://crbug.com/590369 for more details.
- frame().document()->updateStyleAndLayoutTreeForNode(&element);
-
DocumentMarker::MarkerTypes markerTypes(DocumentMarker::Spelling);
markerTypes.add(DocumentMarker::Grammar);
- for (Node& node : NodeTraversal::inclusiveDescendantsOf(element)) {
- if (elementsType == ElementsType::kAll || !hasEditableStyle(node))
- frame().document()->markers().removeMarkers(&node, markerTypes);
- }
+ for (Node& node : NodeTraversal::inclusiveDescendantsOf(*innerEditor))
+ frame().document()->markers().removeMarkers(&node, markerTypes);
}
void SpellChecker::replaceMisspelledRange(const String& text) {

Powered by Google App Engine
This is Rietveld 408576698