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

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

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e2690fe9ff02dfaa8eeb833a46e4bf58eec57ae6..b1d8247167de927328c63ad63f1763a4f38fb5f0 100644
--- a/third_party/WebKit/Source/core/dom/Element.h
+++ b/third_party/WebKit/Source/core/dom/Element.h
@@ -357,6 +357,19 @@ class CORE_EXPORT Element : public ContainerNode {
NamedNodeMap* attributesForBindings() const;
enum class AttributeModificationReason { kDirectly, kByParser, kByCloning };
+ struct AttributeModificationParams {
+ STACK_ALLOCATED();
+ AttributeModificationParams(const QualifiedName& qname,
+ const AtomicString& oldValue,
+ const AtomicString& newValue,
+ AttributeModificationReason reason)
+ : name(qname), oldValue(oldValue), newValue(newValue), reason(reason) {}
+
+ const QualifiedName& name;
+ const AtomicString& oldValue;
+ const AtomicString& newValue;
+ const AttributeModificationReason reason;
+ };
// |attributeChanged| is called whenever an attribute is added, changed or
// removed. It handles very common attributes such as id, class, name, style,
@@ -364,19 +377,14 @@ class CORE_EXPORT Element : public ContainerNode {
//
// 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);
+ virtual void attributeChanged(const AttributeModificationParams&);
// |parseAttribute| is called by |attributeChanged|. If an element
// implementation needs to check an attribute update, override this 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);
+ virtual void parseAttribute(const AttributeModificationParams&);
virtual bool hasLegalLinkAttribute(const QualifiedName&) const;
virtual const QualifiedName& subResourceAttributeName() const;
@@ -718,9 +726,7 @@ class CORE_EXPORT Element : public ContainerNode {
const QualifiedName& attr3);
void logUpdateAttributeIfIsolatedWorldAndInDocument(
const char element[],
- const QualifiedName& attributeName,
- const AtomicString& oldValue,
- const AtomicString& newValue);
+ const AttributeModificationParams&);
DECLARE_VIRTUAL_TRACE();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698