#include "config.h"
#include "core/dom/custom/CustomElementRegistry.h"
-#include "HTMLNames.h"
-#include "SVGNames.h"
-#include "bindings/v8/CustomElementConstructorBuilder.h"
+#include "bindings/core/v8/CustomElementConstructorBuilder.h"
+#include "core/HTMLNames.h"
+#include "core/SVGNames.h"
#include "core/dom/DocumentLifecycleObserver.h"
#include "core/dom/custom/CustomElementException.h"
#include "core/dom/custom/CustomElementRegistrationContext.h"
-namespace WebCore {
+namespace blink {
class RegistrationContextObserver : public DocumentLifecycleObserver {
public:
bool registrationContextWentAway() { return m_wentAway; }
private:
- virtual void documentWasDisposed() OVERRIDE { m_wentAway = true; }
+#if ENABLE(OILPAN)
+ // In oilpan we don't have the disposed phase for context lifecycle observer.
+ virtual void documentWasDetached() override { m_wentAway = true; }
+#else
+ virtual void documentWasDisposed() override { m_wentAway = true; }
+#endif
bool m_wentAway;
};
return 0;
}
- QualifiedName tagName = nullQName();
- if (!constructorBuilder->validateOptions(type, tagName, exceptionState))
- return 0;
-
- ASSERT(tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI || tagName.namespaceURI() == SVGNames::svgNamespaceURI);
-
- // FIXME: This should be done earlier in validateOptions.
if (m_registeredTypeNames.contains(type)) {
CustomElementException::throwException(CustomElementException::TypeAlreadyRegistered, type, exceptionState);
return 0;
}
+ QualifiedName tagName = QualifiedName::null();
+ if (!constructorBuilder->validateOptions(type, tagName, exceptionState))
+ return 0;
+
+ ASSERT(tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI || tagName.namespaceURI() == SVGNames::svgNamespaceURI);
+
ASSERT(!observer.registrationContextWentAway());
RefPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuilder->createCallbacks();
return m_definitions.get(descriptor);
}
-} // namespace WebCore
+} // namespace blink