Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / dom / custom / CustomElementRegistry.cpp
index eedbfaa..985566f 100644 (file)
@@ -53,9 +53,9 @@ public:
 private:
 #if ENABLE(OILPAN)
     // In oilpan we don't have the disposed phase for context lifecycle observer.
-    virtual void documentWasDetached() OVERRIDE { m_wentAway = true; }
+    virtual void documentWasDetached() override { m_wentAway = true; }
 #else
-    virtual void documentWasDisposed() OVERRIDE { m_wentAway = true; }
+    virtual void documentWasDisposed() override { m_wentAway = true; }
 #endif
 
     bool m_wentAway;
@@ -81,18 +81,17 @@ CustomElementDefinition* CustomElementRegistry::registerElement(Document* docume
         return 0;
     }
 
+    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);
 
-    // FIXME: This should be done earlier in validateOptions.
-    if (m_registeredTypeNames.contains(type)) {
-        CustomElementException::throwException(CustomElementException::TypeAlreadyRegistered, type, exceptionState);
-        return 0;
-    }
-
     ASSERT(!observer.registrationContextWentAway());
 
     RefPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuilder->createCallbacks();