diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/chromium/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp b/chromium/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp index e4fb331b654..a6e6e1b274b 100644 --- a/chromium/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp +++ b/chromium/third_party/WebKit/Source/core/dom/custom/CustomElementCallbackInvocation.cpp @@ -31,30 +31,12 @@ #include "config.h" #include "core/dom/custom/CustomElementCallbackInvocation.h" +#include "core/dom/Document.h" #include "core/dom/Element.h" -#include "core/dom/custom/CustomElementCallbackScheduler.h" +#include "core/dom/custom/CustomElementScheduler.h" namespace WebCore { -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()) - CustomElementCallbackScheduler::scheduleAttachedCallback(callbacks(), element); - callbacks()->created(element); -} - class AttachedDetachedInvocation : public CustomElementCallbackInvocation { public: AttachedDetachedInvocation(PassRefPtr<CustomElementLifecycleCallbacks>, CustomElementLifecycleCallbacks::CallbackType which); @@ -111,6 +93,25 @@ 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::scheduleCallback(callbacks(), element, CustomElementLifecycleCallbacks::Attached); + callbacks()->created(element); +} + PassOwnPtr<CustomElementCallbackInvocation> CustomElementCallbackInvocation::createInvocation(PassRefPtr<CustomElementLifecycleCallbacks> callbacks, CustomElementLifecycleCallbacks::CallbackType which) { switch (which) { @@ -120,7 +121,6 @@ PassOwnPtr<CustomElementCallbackInvocation> CustomElementCallbackInvocation::cre case CustomElementLifecycleCallbacks::Attached: case CustomElementLifecycleCallbacks::Detached: return adoptPtr(new AttachedDetachedInvocation(callbacks, which)); - default: ASSERT_NOT_REACHED(); return PassOwnPtr<CustomElementCallbackInvocation>(); |