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

Unified Diff: third_party/WebKit/Source/core/html/TextControlElement.cpp

Issue 2669213002: Remove spelling markers in disabled and readonly form elements
Patch Set: Use setNeedsWillValidateCheck() to avoid crashes 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/invalidation/read-only-write-pseudo-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b85f8e8a06f9744768c1866439e2ae105c4ad529 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"
@@ -713,6 +714,13 @@ void TextControlElement::parseAttribute(
} else {
HTMLFormControlElementWithState::parseAttribute(params);
}
+
+ if ((params.name == disabledAttr || params.name == readonlyAttr) &&
+ (params.oldValue.isNull() != params.newValue.isNull()) &&
+ isTextControl() && isDisabledOrReadOnly() && document().frame()) {
+ setNeedsWillValidateCheck();
tkent 2017/02/07 14:17:06 Why do we need setNeedsWillValidateCheck()?
Manuel Rego 2017/02/07 15:06:03 Now that we use parseAttribute() I need to call se
yosin_UTC9 2017/02/08 02:07:44 It seems we should refactor removeSpellingAndGramm
tkent 2017/02/08 02:12:14 Thanks. I understand. We handle |disabled| attri
Manuel Rego 2017/02/08 09:00:34 We still need to use hasEditableStyle() in removeS
+ document().frame()->spellChecker().didEndEditingOnTextField(this);
+ }
}
bool TextControlElement::lastChangeWasUserEdit() const {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/invalidation/read-only-write-pseudo-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698