Index: Source/core/dom/CustomElementRegistry.cpp |
diff --git a/Source/core/dom/CustomElementRegistry.cpp b/Source/core/dom/CustomElementRegistry.cpp |
index a5cfe5eca2565a6575bf64ddb5392c15ef014725..9efd199c2dc77dd0c388524bdcef41eddf65a3d6 100644 |
--- a/Source/core/dom/CustomElementRegistry.cpp |
+++ b/Source/core/dom/CustomElementRegistry.cpp |
@@ -206,11 +206,13 @@ PassRefPtr<CustomElementDefinition> CustomElementRegistry::findAndCheckNamespace |
return it->value; |
} |
-PassRefPtr<Element> CustomElementRegistry::tryToCreateCustomTagElement(const QualifiedName& tagName) |
+PassRefPtr<Element> CustomElementRegistry::createCustomTagElement(const QualifiedName& tagName) |
{ |
- if (!document() || !isValidName(tagName.localName())) |
+ if (!document()) |
return 0; |
+ ASSERT(isCustomTagName(tagName.localName())); |
+ |
RefPtr<Element> element; |
if (HTMLNames::xhtmlNamespaceURI == tagName.namespaceURI()) |
@@ -223,10 +225,9 @@ PassRefPtr<Element> CustomElementRegistry::tryToCreateCustomTagElement(const Qua |
element = Element::create(tagName, document()); |
RefPtr<CustomElementDefinition> definition = findAndCheckNamespace(tagName.localName(), tagName.namespaceURI()); |
- if (!definition || definition->isTypeExtension()) |
- return 0; |
+ if (definition && !definition->isTypeExtension()) |
+ didCreateCustomTagElement(element.get()); |
- didCreateElement(element.get()); |
return element.release(); |
} |
@@ -238,7 +239,7 @@ void CustomElementRegistry::didGiveTypeExtension(Element* element) |
activate(CustomElementInvocation(element)); |
} |
-void CustomElementRegistry::didCreateElement(Element* element) |
+void CustomElementRegistry::didCreateCustomTagElement(Element* element) |
{ |
activate(CustomElementInvocation(element)); |
} |