Index: Source/core/dom/CustomElementRegistry.cpp |
diff --git a/Source/core/dom/CustomElementRegistry.cpp b/Source/core/dom/CustomElementRegistry.cpp |
index 9efd199c2dc77dd0c388524bdcef41eddf65a3d6..832c76191bab81de554f9045c19ac68db5a41b4a 100644 |
--- a/Source/core/dom/CustomElementRegistry.cpp |
+++ b/Source/core/dom/CustomElementRegistry.cpp |
@@ -174,13 +174,12 @@ PassRefPtr<CustomElementDefinition> CustomElementRegistry::findFor(Element* elem |
{ |
ASSERT(element->document()->registry() == this); |
- // Most elements can be rejected with this quick screening. |
- if (!nameIncludesHyphen(element->tagName()) && !element->hasAttribute(HTMLNames::isAttr)) |
+ if (!element->isCustomElement()) |
return 0; |
// When a custom tag and a type extension are provided as element |
// names at the same time, the custom tag takes precedence. |
- if (isValidName(element->localName())) { |
+ if (isCustomTagName(element->localName())) { |
if (RefPtr<CustomElementDefinition> definition = findAndCheckNamespace(element->localName(), element->namespaceURI())) |
return definition->isTypeExtension() ? 0 : definition.release(); |
} |
@@ -224,6 +223,8 @@ PassRefPtr<Element> CustomElementRegistry::createCustomTagElement(const Qualifie |
else |
element = Element::create(tagName, document()); |
+ element->setIsCustomElement(); |
+ |
RefPtr<CustomElementDefinition> definition = findAndCheckNamespace(tagName.localName(), tagName.namespaceURI()); |
if (definition && !definition->isTypeExtension()) |
didCreateCustomTagElement(element.get()); |
@@ -233,6 +234,7 @@ PassRefPtr<Element> CustomElementRegistry::createCustomTagElement(const Qualifie |
void CustomElementRegistry::didGiveTypeExtension(Element* element) |
{ |
+ element->setIsCustomElement(); |
RefPtr<CustomElementDefinition> definition = findFor(element); |
if (!definition || !definition->isTypeExtension()) |
return; |