OLD | NEW |
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 Loading... |
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 |
OLD | NEW |