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

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

Issue 1914923002: Rename all existing custom element classes as V0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CustomElementV0 -> V0CustomElement 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 unified diff | Download patch
OLDNEW
1 {% from "macros.tmpl" import license %} 1 {% from "macros.tmpl" import license %}
2 {{ license() }} 2 {{ license() }}
3 3
4 #include "{{namespace}}ElementFactory.h" 4 #include "{{namespace}}ElementFactory.h"
5 5
6 #include "{{namespace}}Names.h" 6 #include "{{namespace}}Names.h"
7 {% for tag in tags|groupby('interface') %} 7 {% for tag in tags|groupby('interface') %}
8 #include "core/{{namespace|lower}}/{{tag[0]}}.h" 8 #include "core/{{namespace|lower}}/{{tag[0]}}.h"
9 {% endfor %} 9 {% endfor %}
10 {% if fallback_interface %} 10 {% if fallback_interface %}
11 #include "core/{{namespace|lower}}/{{fallback_interface}}.h" 11 #include "core/{{namespace|lower}}/{{fallback_interface}}.h"
12 {% endif %} 12 {% endif %}
13 #include "core/dom/custom/CustomElement.h" 13 #include "core/dom/custom/V0CustomElement.h"
14 #include "core/dom/custom/CustomElementRegistrationContext.h" 14 #include "core/dom/custom/V0CustomElementRegistrationContext.h"
15 #include "core/dom/Document.h" 15 #include "core/dom/Document.h"
16 #include "core/frame/Settings.h" 16 #include "core/frame/Settings.h"
17 #include "platform/RuntimeEnabledFeatures.h" 17 #include "platform/RuntimeEnabledFeatures.h"
18 #include "wtf/HashMap.h" 18 #include "wtf/HashMap.h"
19 19
20 namespace blink { 20 namespace blink {
21 21
22 using namespace {{namespace}}Names; 22 using namespace {{namespace}}Names;
23 23
24 typedef {{namespace}}Element* (*ConstructorFunction)( 24 typedef {{namespace}}Element* (*ConstructorFunction)(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 {% if namespace == 'HTML' %} 79 {% if namespace == 'HTML' %}
80 HTMLFormElement* formElement, 80 HTMLFormElement* formElement,
81 {% endif %} 81 {% endif %}
82 bool createdByParser) 82 bool createdByParser)
83 { 83 {
84 if (!g_constructors) 84 if (!g_constructors)
85 create{{namespace}}FunctionMap(); 85 create{{namespace}}FunctionMap();
86 if (ConstructorFunction function = g_constructors->get(localName)) 86 if (ConstructorFunction function = g_constructors->get(localName))
87 return function(document, {% if namespace == 'HTML' %}formElement, {% en dif %}createdByParser); 87 return function(document, {% if namespace == 'HTML' %}formElement, {% en dif %}createdByParser);
88 88
89 if (document.registrationContext() && CustomElement::isValidName(localName)) { 89 if (document.registrationContext() && V0CustomElement::isValidName(localName )) {
90 Element* element = document.registrationContext()->createCustomTagElemen t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI) ); 90 Element* element = document.registrationContext()->createCustomTagElemen t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI) );
91 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); 91 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element());
92 return to{{namespace}}Element(element); 92 return to{{namespace}}Element(element);
93 } 93 }
94 94
95 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document); 95 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document);
96 } 96 }
97 97
98 } // namespace blink 98 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp ('k') | third_party/WebKit/Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698