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

Unified Diff: Source/core/dom/custom/CustomElementRegistry.cpp

Issue 467033006: Check for type registeration of Custom element before validating options (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/custom/CustomElementRegistry.cpp
diff --git a/Source/core/dom/custom/CustomElementRegistry.cpp b/Source/core/dom/custom/CustomElementRegistry.cpp
index eedbfaa8b750ed1087dcb553b5f9b4099075c27f..a3b9775947ca47e3be8beaadbe578a655a2edc81 100644
--- a/Source/core/dom/custom/CustomElementRegistry.cpp
+++ b/Source/core/dom/custom/CustomElementRegistry.cpp
@@ -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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698