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

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

Issue 2650183002: Remove spelling markers when element is not editable (Closed)
Patch Set: Add Mac and Windows baselines 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/html/HTMLElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp
index deaffb100f9afb20f25292e1f32f9b3112c24a82..d09e577cf9286b91d8068c8c195049eb2d39f7ce 100644
--- a/third_party/WebKit/Source/core/html/HTMLElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -46,6 +46,7 @@
#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/EditingUtilities.h"
#include "core/editing/serializers/Serialization.h"
+#include "core/editing/spellcheck/SpellChecker.h"
#include "core/events/EventListener.h"
#include "core/events/KeyboardEvent.h"
#include "core/frame/Settings.h"
@@ -436,6 +437,8 @@ void HTMLElement::attributeChanged(const AttributeModificationParams& params) {
if (adjustedFocusedElementInTreeScope() == this)
blur();
} else if (params.name == contenteditableAttr) {
+ if (params.newValue.isNull() || equalIgnoringCase(params.newValue, "false"))
+ document().frame()->spellChecker().removeSpellingAndGrammarMarkers(*this);
yosin_UTC9 2017/01/25 02:31:41 Do we really need to remove markers synchronously?
Xiaocheng 2017/01/25 02:56:57 I think synchronous marker removal is fine, as we
Manuel Rego 2017/01/25 08:03:10 Good catch! Probably I should use isEditable() to
if (adjustedFocusedElementInTreeScope() != this)
return;
// The attribute change may cause supportsFocus() to return false
@@ -457,6 +460,11 @@ void HTMLElement::parseAttribute(const AttributeModificationParams& params) {
dirAttributeChanged(params.newValue);
} else if (params.name == langAttr) {
pseudoStateChanged(CSSSelector::PseudoLang);
+ } else if (params.name == contenteditableAttr) {
+ if (params.newValue.isNull() ||
+ equalIgnoringCase(params.newValue, "false")) {
+ // document().frame()->spellChecker().removeSpellingAndGrammarMarkers(*this);
yosin_UTC9 2017/01/25 02:31:41 Could you remove this comment?
Manuel Rego 2017/01/25 08:03:10 Sure this is a leftover from a previous version of
+ }
} else {
const AtomicString& eventName = eventNameForAttributeName(params.name);
if (!eventName.isNull()) {

Powered by Google App Engine
This is Rietveld 408576698