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

Unified Diff: third_party/WebKit/Source/core/dom/Element.h

Issue 2586143004: Blur immediately if an attribute change made an element unfocasable. (Closed)
Patch Set: rebase Created 4 years 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/dom/Element.h
diff --git a/third_party/WebKit/Source/core/dom/Element.h b/third_party/WebKit/Source/core/dom/Element.h
index 11609296c0342b452b9a1a758c2dc39cc0702cd3..5deff49d5d52ba9ef0b4121c6cc13a1f0de033c7 100644
--- a/third_party/WebKit/Source/core/dom/Element.h
+++ b/third_party/WebKit/Source/core/dom/Element.h
@@ -356,13 +356,25 @@ class CORE_EXPORT Element : public ContainerNode {
// For exposing to DOM only.
NamedNodeMap* attributesForBindings() const;
- enum AttributeModificationReason { ModifiedDirectly, ModifiedByCloning };
-
- // This method is called whenever an attribute is added, changed or removed.
+ enum class AttributeModificationReason { kDirectly, kByParser, kByCloning };
+
+ // |attributeChanged| is called whenever an attribute is added, changed or
+ // removed. It handles very common attributes such as id, class, name, style,
+ // and slot.
+ //
+ // While the owner document is parsed, this function is called after all
+ // attributes in a start tag were added to the element.
virtual void attributeChanged(const QualifiedName&,
const AtomicString& oldValue,
const AtomicString& newValue,
- AttributeModificationReason = ModifiedDirectly);
+ AttributeModificationReason);
+
+ // |parseAttribute| is called by |attributeChanged|. If an element
+ // implementation needs to check an attribute update, we should override this
kochi 2016/12/21 05:58:09 nit: avoid "we" and just "override this function"
tkent 2016/12/21 06:51:15 Will do.
+ // function.
+ //
+ // While the owner document is parsed, this function is called after all
+ // attributes in a start tag were added to the element.
virtual void parseAttribute(const QualifiedName&,
const AtomicString& oldValue,
const AtomicString& newValue);

Powered by Google App Engine
This is Rietveld 408576698