Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/TextControlElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/TextControlElement.cpp b/third_party/WebKit/Source/core/html/TextControlElement.cpp |
| index 1286574aecb2df48cb31c388a30bacdcc8aeb0c0..5e5b6c91568077cf0b98b62ed7fd7d9dc30b1074 100644 |
| --- a/third_party/WebKit/Source/core/html/TextControlElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/TextControlElement.cpp |
| @@ -37,6 +37,7 @@ |
| #include "core/editing/iterators/CharacterIterator.h" |
| #include "core/editing/iterators/TextIterator.h" |
| #include "core/editing/serializers/Serialization.h" |
| +#include "core/editing/spellcheck/SpellChecker.h" |
| #include "core/events/Event.h" |
| #include "core/frame/LocalFrame.h" |
| #include "core/frame/UseCounter.h" |
| @@ -907,4 +908,24 @@ void TextControlElement::copyNonAttributePropertiesFromElement( |
| HTMLFormControlElement::copyNonAttributePropertiesFromElement(source); |
| } |
| +void TextControlElement::disabledAttributeChanged() { |
| + HTMLFormControlElement::disabledAttributeChanged(); |
| + removeSpellingAndGrammarMarkersOnInnerEditor(); |
| +} |
| + |
| +void TextControlElement::readonlyAttributeChanged() { |
| + HTMLFormControlElement::readonlyAttributeChanged(); |
| + removeSpellingAndGrammarMarkersOnInnerEditor(); |
| +} |
| + |
| +void TextControlElement::removeSpellingAndGrammarMarkersOnInnerEditor() { |
|
Xiaocheng
2017/02/03 04:54:07
This function seems unnecessary. I think checking
|
| + if (isDisabledOrReadOnly()) { |
| + HTMLElement* innerEditor = innerEditorElement(); |
| + if (innerEditor) { |
| + document().frame()->spellChecker().removeSpellingAndGrammarMarkers( |
| + *innerEditor); |
| + } |
| + } |
| +} |
| + |
| } // namespace blink |