Index: Source/core/dom/CustomElementRegistry.cpp |
diff --git a/Source/core/dom/CustomElementRegistry.cpp b/Source/core/dom/CustomElementRegistry.cpp |
index 9040253b983959e132e7e5b7803d345cff6edbec..7ad2c3075f27aa32d06c2d519c21a50e2c5e9742 100644 |
--- a/Source/core/dom/CustomElementRegistry.cpp |
+++ b/Source/core/dom/CustomElementRegistry.cpp |
@@ -205,11 +205,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()) |
@@ -222,10 +224,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(); |
haraken
2013/05/01 18:49:12
This will change behavior. Previously 0 was return
dominicc (has gone to gerrit)
2013/05/02 01:29:56
Absolutely. That is what we're going for here, hen
|
} |
@@ -237,7 +238,7 @@ void CustomElementRegistry::didGiveTypeExtension(Element* element) |
activate(CustomElementInvocation(element)); |
} |
-void CustomElementRegistry::didCreateElement(Element* element) |
+void CustomElementRegistry::didCreateCustomTagElement(Element* element) |
{ |
activate(CustomElementInvocation(element)); |
} |