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

Unified Diff: third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl

Issue 2002903002: Hook createElement for Custom Elements V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dominicc review Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
index d9715a1e575fde344ff0aeb56a84700117251489..d9c20acffca56d601bc05c2f70515765ef97d040 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
@@ -10,6 +10,9 @@
{% if fallback_interface %}
#include "core/{{namespace|lower}}/{{fallback_interface}}.h"
{% endif %}
+{% if namespace == 'HTML' %}
+#include "core/dom/custom/CustomElement.h"
+{% endif %}
#include "core/dom/custom/V0CustomElement.h"
#include "core/dom/custom/V0CustomElementRegistrationContext.h"
#include "core/dom/Document.h"
@@ -86,6 +89,11 @@ static void create{{namespace}}FunctionMap()
if (ConstructorFunction function = g_constructors->get(localName))
return function(document, {% if namespace == 'HTML' %}formElement, {% endif %}createdByParser);
+ {% if namespace == 'HTML' %}
+ if (CustomElement::shouldCreateCustomElement(document, localName))
+ return CustomElement::createCustomElement(document, localName);
+ {% endif %}
+
if (document.registrationContext() && V0CustomElement::isValidName(localName)) {
Element* element = document.registrationContext()->createCustomTagElement(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI));
ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element());
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698