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

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: Use toV8 in the constructor. Remove unused variable. 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
« no previous file with comments | « Source/core/dom/CustomElementRegistry.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « Source/core/dom/CustomElementRegistry.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698