| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 }; | 74 }; |
| 75 for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++) | 75 for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++) |
| 76 g_constructors->set(data[i].tag.localName(), data[i].func); | 76 g_constructors->set(data[i].tag.localName(), data[i].func); |
| 77 } | 77 } |
| 78 | 78 |
| 79 {{namespace}}Element* {{namespace}}ElementFactory::create{{namespace}}Element( | 79 {{namespace}}Element* {{namespace}}ElementFactory::create{{namespace}}Element( |
| 80 const AtomicString& localName, | 80 const AtomicString& localName, |
| 81 Document& document, | 81 Document& document, |
| 82 {% if namespace == 'HTML' %} | 82 {% if namespace == 'HTML' %} |
| 83 HTMLFormElement* formElement, | 83 HTMLFormElement* formElement, |
| 84 ExceptionState* exceptionState, |
| 84 {% endif %} | 85 {% endif %} |
| 85 CreateElementFlags flags) | 86 CreateElementFlags flags) |
| 86 { | 87 { |
| 87 if (!g_constructors) | 88 if (!g_constructors) |
| 88 create{{namespace}}FunctionMap(); | 89 create{{namespace}}FunctionMap(); |
| 89 if (ConstructorFunction function = g_constructors->get(localName)) | 90 if (ConstructorFunction function = g_constructors->get(localName)) |
| 90 return function(document, {% if namespace == 'HTML' %}formElement, {% en
dif %}flags); | 91 return function(document, {% if namespace == 'HTML' %}formElement, {% en
dif %}flags); |
| 91 | 92 |
| 92 {% if namespace == 'HTML' %} | 93 {% if namespace == 'HTML' %} |
| 93 if (CustomElement::shouldCreateCustomElement(localName)) { | 94 if (CustomElement::shouldCreateCustomElement(localName)) { |
| 94 QualifiedName tagName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI)
; | 95 QualifiedName tagName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI)
; |
| 95 if (flags & AsynchronousCustomElements) | 96 if (flags & AsynchronousCustomElements) |
| 96 return CustomElement::createCustomElementAsync(document, tagName); | 97 return CustomElement::createCustomElementAsync(document, tagName); |
| 97 return CustomElement::createCustomElementSync(document, tagName); | 98 return CustomElement::createCustomElementSync(document, tagName, excepti
onState); |
| 98 } | 99 } |
| 99 {% endif %} | 100 {% endif %} |
| 100 | 101 |
| 101 if (document.registrationContext() && V0CustomElement::isValidName(localName
)) { | 102 if (document.registrationContext() && V0CustomElement::isValidName(localName
)) { |
| 102 Element* element = document.registrationContext()->createCustomTagElemen
t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI)
); | 103 Element* element = document.registrationContext()->createCustomTagElemen
t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI)
); |
| 103 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); | 104 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); |
| 104 return to{{namespace}}Element(element); | 105 return to{{namespace}}Element(element); |
| 105 } | 106 } |
| 106 | 107 |
| 107 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n
amespace_prefix}}NamespaceURI), document); | 108 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n
amespace_prefix}}NamespaceURI), document); |
| 108 } | 109 } |
| 109 | 110 |
| 110 } // namespace blink | 111 } // namespace blink |
| OLD | NEW |