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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLElement.cpp

Issue 2650183002: Remove spelling markers when element is not editable (Closed)
Patch Set: Apply suggested changes 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2008, 2013, 2014 Apple Inc. All rights reserved.
5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 28 matching lines...) Expand all
39 #include "core/dom/ElementTraversal.h" 39 #include "core/dom/ElementTraversal.h"
40 #include "core/dom/ExceptionCode.h" 40 #include "core/dom/ExceptionCode.h"
41 #include "core/dom/NodeTraversal.h" 41 #include "core/dom/NodeTraversal.h"
42 #include "core/dom/StyleChangeReason.h" 42 #include "core/dom/StyleChangeReason.h"
43 #include "core/dom/Text.h" 43 #include "core/dom/Text.h"
44 #include "core/dom/shadow/ElementShadow.h" 44 #include "core/dom/shadow/ElementShadow.h"
45 #include "core/dom/shadow/FlatTreeTraversal.h" 45 #include "core/dom/shadow/FlatTreeTraversal.h"
46 #include "core/dom/shadow/ShadowRoot.h" 46 #include "core/dom/shadow/ShadowRoot.h"
47 #include "core/editing/EditingUtilities.h" 47 #include "core/editing/EditingUtilities.h"
48 #include "core/editing/serializers/Serialization.h" 48 #include "core/editing/serializers/Serialization.h"
49 #include "core/editing/spellcheck/SpellChecker.h"
49 #include "core/events/EventListener.h" 50 #include "core/events/EventListener.h"
50 #include "core/events/KeyboardEvent.h" 51 #include "core/events/KeyboardEvent.h"
51 #include "core/frame/Settings.h" 52 #include "core/frame/Settings.h"
52 #include "core/frame/UseCounter.h" 53 #include "core/frame/UseCounter.h"
53 #include "core/html/HTMLBRElement.h" 54 #include "core/html/HTMLBRElement.h"
54 #include "core/html/HTMLDimension.h" 55 #include "core/html/HTMLDimension.h"
55 #include "core/html/HTMLFormElement.h" 56 #include "core/html/HTMLFormElement.h"
56 #include "core/html/HTMLInputElement.h" 57 #include "core/html/HTMLInputElement.h"
57 #include "core/html/HTMLMenuElement.h" 58 #include "core/html/HTMLMenuElement.h"
58 #include "core/html/HTMLTemplateElement.h" 59 #include "core/html/HTMLTemplateElement.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 void HTMLElement::attributeChanged(const AttributeModificationParams& params) { 430 void HTMLElement::attributeChanged(const AttributeModificationParams& params) {
430 Element::attributeChanged(params); 431 Element::attributeChanged(params);
431 if (params.reason != AttributeModificationReason::kDirectly) 432 if (params.reason != AttributeModificationReason::kDirectly)
432 return; 433 return;
433 // adjustedFocusedElementInTreeScope() is not trivial. We should check 434 // adjustedFocusedElementInTreeScope() is not trivial. We should check
434 // attribute names, then call adjustedFocusedElementInTreeScope(). 435 // attribute names, then call adjustedFocusedElementInTreeScope().
435 if (params.name == hiddenAttr && !params.newValue.isNull()) { 436 if (params.name == hiddenAttr && !params.newValue.isNull()) {
436 if (adjustedFocusedElementInTreeScope() == this) 437 if (adjustedFocusedElementInTreeScope() == this)
437 blur(); 438 blur();
438 } else if (params.name == contenteditableAttr) { 439 } else if (params.name == contenteditableAttr) {
440 document().frame()->spellChecker().removeSpellingAndGrammarMarkers(
441 *this, SpellChecker::ElementsType::kOnlyNonEditable);
439 if (adjustedFocusedElementInTreeScope() != this) 442 if (adjustedFocusedElementInTreeScope() != this)
440 return; 443 return;
441 // The attribute change may cause supportsFocus() to return false 444 // The attribute change may cause supportsFocus() to return false
442 // for the element which had focus. 445 // for the element which had focus.
443 // 446 //
444 // TODO(tkent): We should avoid updating style. We'd like to check only 447 // TODO(tkent): We should avoid updating style. We'd like to check only
445 // DOM-level focusability here. 448 // DOM-level focusability here.
446 document().updateStyleAndLayoutTreeForNode(this); 449 document().updateStyleAndLayoutTreeForNode(this);
447 if (!supportsFocus()) 450 if (!supportsFocus())
448 blur(); 451 blur();
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 1218
1216 #ifndef NDEBUG 1219 #ifndef NDEBUG
1217 1220
1218 // For use in the debugger 1221 // For use in the debugger
1219 void dumpInnerHTML(blink::HTMLElement*); 1222 void dumpInnerHTML(blink::HTMLElement*);
1220 1223
1221 void dumpInnerHTML(blink::HTMLElement* element) { 1224 void dumpInnerHTML(blink::HTMLElement* element) {
1222 printf("%s\n", element->innerHTML().ascii().data()); 1225 printf("%s\n", element->innerHTML().ascii().data());
1223 } 1226 }
1224 #endif 1227 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698