Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(617)

Unified Diff: Source/core/dom/CustomElementRegistrationContext.h

Issue 18332025: Split CustomElementRegistry into a registration context and a registry. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced to tip. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/CustomElementRegistrationContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
+
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/CustomElementRegistrationContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698