| Index: Source/core/dom/custom/CustomElementCallbackInvocation.cpp
|
| diff --git a/Source/core/dom/custom/CustomElementCallbackInvocation.cpp b/Source/core/dom/custom/CustomElementCallbackInvocation.cpp
|
| index a033323c759508d76658106768cb6cdb77f3d0d4..b7eb8e4d0d751e96b91eb0067b2efe6de5ec4e0a 100644
|
| --- a/Source/core/dom/custom/CustomElementCallbackInvocation.cpp
|
| +++ b/Source/core/dom/custom/CustomElementCallbackInvocation.cpp
|
| @@ -92,9 +92,31 @@ void AttributeChangedInvocation::dispatch(Element* element)
|
| 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));
|
|
|