callbacks()->attributeChanged(element, m_name, m_oldValue, m_newValue);
}
+class CreatedInvocation : public CustomElementCallbackInvocation {
+public:
+ CreatedInvocation(PassRefPtr<CustomElementLifecycleCallbacks> callbacks)
+ : CustomElementCallbackInvocation(callbacks)
+ {
+ }
+
+private:
+ virtual void dispatch(Element*) OVERRIDE;
+ virtual bool isCreated() const OVERRIDE { return true; }
+};
+
+void CreatedInvocation::dispatch(Element* element)
+{
+ if (element->inDocument() && element->document().domWindow())
+ CustomElementScheduler::scheduleAttachedCallback(callbacks(), element);
+ callbacks()->created(element);
+}
+
PassOwnPtr<CustomElementCallbackInvocation> CustomElementCallbackInvocation::createInvocation(PassRefPtr<CustomElementLifecycleCallbacks> callbacks, CustomElementLifecycleCallbacks::CallbackType which)
{
switch (which) {
+ case CustomElementLifecycleCallbacks::Created:
+ return adoptPtr(new CreatedInvocation(callbacks));
+
case CustomElementLifecycleCallbacks::Attached:
case CustomElementLifecycleCallbacks::Detached:
return adoptPtr(new AttachedDetachedInvocation(callbacks, which));