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

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

Issue 14776002: Create wrappers for unresolved Custom Elements at the correct type (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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
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));
}

Powered by Google App Engine
This is Rietveld 408576698