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

Unified Diff: Source/core/dom/Element.cpp

Issue 18789002: Implement Custom Elements' attributeChangedCallback. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Sync to tip. Created 7 years, 5 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 | « Source/core/dom/CustomElementLifecycleCallbacks.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 66fb5b92a82a6eba7ffdaee9ce5fd05651191c2d..2d21a43b0d8f3cea956828f9ca8b3e6aac3ebc79 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -42,6 +42,7 @@
#include "core/dom/Attribute.h"
#include "core/dom/ClientRect.h"
#include "core/dom/ClientRectList.h"
+#include "core/dom/CustomElementCallbackDispatcher.h"
#include "core/dom/CustomElementRegistry.h"
#include "core/dom/DatasetDOMStringMap.h"
#include "core/dom/Document.h"
@@ -2803,6 +2804,11 @@ void Element::willModifyAttribute(const QualifiedName& name, const AtomicString&
recipients->enqueueMutationRecord(MutationRecord::createAttributes(this, name, oldValue));
InspectorInstrumentation::willModifyDOMAttr(document(), this, oldValue, newValue);
+
+ if (isUpgradedCustomElement()) {
+ RefPtr<CustomElementDefinition> definition = document()->registry()->findFor(this);
+ CustomElementCallbackDispatcher::instance().enqueueAttributeChangedCallback(definition->callbacks(), this, name.localName(), oldValue, newValue);
+ }
}
void Element::didAddAttribute(const QualifiedName& name, const AtomicString& value)
« no previous file with comments | « Source/core/dom/CustomElementLifecycleCallbacks.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698