Chromium Code Reviews| 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); |