X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Fdom%2Fcustom%2FCustomElementCallbackInvocation.cpp;h=b7eb8e4d0d751e96b91eb0067b2efe6de5ec4e0a;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=a033323c759508d76658106768cb6cdb77f3d0d4;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp b/src/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp index a033323..b7eb8e4 100644 --- a/src/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp +++ b/src/third_party/WebKit/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 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::createInvocation(PassRefPtr 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));