| 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(localName)) { | 93 // createElement handles custom element creation itself in order to |
| 94 // transmit exceptions. |
| 95 // TODO(dominicc): When the HTML parser can pass an error |
| 96 // reporting ExceptionState, and "v0" custom elements have been |
| 97 // removed, consolidate custom element creation into one place. |
| 98 if (flags != CreatedByCreateElement && CustomElement::shouldCreateCustomElem
ent(localName)) { |
| 94 QualifiedName tagName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI)
; | 99 QualifiedName tagName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI)
; |
| 95 if (flags & AsynchronousCustomElements) | 100 if (flags & AsynchronousCustomElements) |
| 96 return CustomElement::createCustomElementAsync(document, tagName); | 101 return CustomElement::createCustomElementAsync(document, tagName); |
| 97 return CustomElement::createCustomElementSync(document, tagName); | 102 return CustomElement::createCustomElementSync(document, tagName); |
| 98 } | 103 } |
| 99 {% endif %} | 104 {% endif %} |
| 100 | 105 |
| 101 if (document.registrationContext() && V0CustomElement::isValidName(localName
)) { | 106 if (document.registrationContext() && V0CustomElement::isValidName(localName
)) { |
| 102 Element* element = document.registrationContext()->createCustomTagElemen
t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI)
); | 107 Element* element = document.registrationContext()->createCustomTagElemen
t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI)
); |
| 103 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); | 108 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); |
| 104 return to{{namespace}}Element(element); | 109 return to{{namespace}}Element(element); |
| 105 } | 110 } |
| 106 | 111 |
| 107 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n
amespace_prefix}}NamespaceURI), document); | 112 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n
amespace_prefix}}NamespaceURI), document); |
| 108 } | 113 } |
| 109 | 114 |
| 110 } // namespace blink | 115 } // namespace blink |
| OLD | NEW |