| Index: Source/core/dom/CustomElementRegistrationContext.h
|
| diff --git a/Source/core/dom/CustomElementCallbackInvocation.h b/Source/core/dom/CustomElementRegistrationContext.h
|
| similarity index 51%
|
| copy from Source/core/dom/CustomElementCallbackInvocation.h
|
| copy to Source/core/dom/CustomElementRegistrationContext.h
|
| index c6f081862e39bcb5a8e179bb099d3f533a83021e..b675300eb94cf43f1d94f7a717d81160ebaea168 100644
|
| --- a/Source/core/dom/CustomElementCallbackInvocation.h
|
| +++ b/Source/core/dom/CustomElementRegistrationContext.h
|
| @@ -28,40 +28,53 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef CustomElementCallbackInvocation_h
|
| -#define CustomElementCallbackInvocation_h
|
| +#ifndef CustomElementRegistrationContext_h
|
| +#define CustomElementRegistrationContext_h
|
|
|
| -#include "core/dom/CustomElementLifecycleCallbacks.h"
|
| -#include "wtf/PassOwnPtr.h"
|
| +#include "core/dom/CustomElementDescriptor.h"
|
| +#include "core/dom/ExceptionCode.h"
|
| +#include "core/dom/QualifiedName.h"
|
| #include "wtf/PassRefPtr.h"
|
| #include "wtf/RefPtr.h"
|
| #include "wtf/text/AtomicString.h"
|
|
|
| namespace WebCore {
|
|
|
| +class CustomElementConstructorBuilder;
|
| +class Document;
|
| class Element;
|
|
|
| -class CustomElementCallbackInvocation {
|
| - WTF_MAKE_NONCOPYABLE(CustomElementCallbackInvocation);
|
| +class CustomElementRegistrationContext : public RefCounted<CustomElementRegistrationContext> {
|
| public:
|
| - static PassOwnPtr<CustomElementCallbackInvocation> createInvocation(PassRefPtr<CustomElementLifecycleCallbacks>, CustomElementLifecycleCallbacks::CallbackType);
|
| - static PassOwnPtr<CustomElementCallbackInvocation> createAttributeChangedInvocation(PassRefPtr<CustomElementLifecycleCallbacks>, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue);
|
| + static PassRefPtr<CustomElementRegistrationContext> nullRegistrationContext();
|
| + static PassRefPtr<CustomElementRegistrationContext> create();
|
|
|
| - virtual ~CustomElementCallbackInvocation() { }
|
| - virtual void dispatch(Element*) = 0;
|
| + virtual ~CustomElementRegistrationContext() { }
|
|
|
| -protected:
|
| - CustomElementCallbackInvocation(PassRefPtr<CustomElementLifecycleCallbacks> callbacks)
|
| - : m_callbacks(callbacks)
|
| - {
|
| - }
|
| + // Model
|
| + static bool isValidTypeName(const AtomicString& type);
|
| + static bool isCustomTagName(const AtomicString& localName);
|
| + virtual CustomElementDescriptor describe(Element*) const = 0;
|
| +
|
| + // Definitions
|
| + virtual void registerElement(Document*, CustomElementConstructorBuilder*, const AtomicString& type, ExceptionCode&) = 0;
|
| +
|
| + // Instance creation
|
| + virtual PassRefPtr<Element> createCustomTagElement(Document*, const QualifiedName&) = 0;
|
| + void setTypeExtension(Element*, const AtomicString& type);
|
| + virtual void didGiveTypeExtension(Element*, const AtomicString& type) = 0;
|
|
|
| - CustomElementLifecycleCallbacks* callbacks() { return m_callbacks.get(); }
|
| + // Instance lifecycle
|
| + virtual void customElementAttributeDidChange(Element*, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue) = 0;
|
| + virtual void customElementDidEnterDocument(Element*) = 0;
|
| + virtual void customElementDidLeaveDocument(Element*) = 0;
|
| + virtual void customElementIsBeingDestroyed(Element*) = 0;
|
|
|
| -private:
|
| - RefPtr<CustomElementLifecycleCallbacks> m_callbacks;
|
| +protected:
|
| + CustomElementRegistrationContext() { }
|
| };
|
|
|
| }
|
|
|
| -#endif // CustomElementCallbackInvocation_h
|
| +#endif // CustomElementRegistrationContext_h
|
| +
|
|
|