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

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

Issue 2054433002: Implement "create an element" when sync for Custom Element V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-ce
Patch Set: haraken review and rebase Created 4 years, 6 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 %}
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 HTMLFormElement* formElement, 83 HTMLFormElement* formElement,
84 {% endif %} 84 {% endif %}
85 CreateElementFlags flags) 85 CreateElementFlags flags)
86 { 86 {
87 if (!g_constructors) 87 if (!g_constructors)
88 create{{namespace}}FunctionMap(); 88 create{{namespace}}FunctionMap();
89 if (ConstructorFunction function = g_constructors->get(localName)) 89 if (ConstructorFunction function = g_constructors->get(localName))
90 return function(document, {% if namespace == 'HTML' %}formElement, {% en dif %}flags); 90 return function(document, {% if namespace == 'HTML' %}formElement, {% en dif %}flags);
91 91
92 {% if namespace == 'HTML' %} 92 {% if namespace == 'HTML' %}
93 if (CustomElement::shouldCreateCustomElement(document, localName)) 93 if (CustomElement::shouldCreateCustomElement(document, localName)) {
94 return CustomElement::createCustomElement(document, localName, flags); 94 QualifiedName tagName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI) ;
95 if (flags & AsynchronousCustomElements)
96 return CustomElement::createCustomElementAsync(document, tagName);
97 return CustomElement::createCustomElementSync(document, tagName);
98 }
95 {% endif %} 99 {% endif %}
96 100
97 if (document.registrationContext() && V0CustomElement::isValidName(localName )) { 101 if (document.registrationContext() && V0CustomElement::isValidName(localName )) {
98 Element* element = document.registrationContext()->createCustomTagElemen t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI) ); 102 Element* element = document.registrationContext()->createCustomTagElemen t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI) );
99 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); 103 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element());
100 return to{{namespace}}Element(element); 104 return to{{namespace}}Element(element);
101 } 105 }
102 106
103 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document); 107 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document);
104 } 108 }
105 109
106 } // namespace blink 110 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698