Chromium Code Reviews| 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 %} |
| 11 #include "core/{{namespace|lower}}/{{fallback_interface}}.h" | 11 #include "core/{{namespace|lower}}/{{fallback_interface}}.h" |
| 12 {% endif %} | 12 {% endif %} |
| 13 {% if namespace == 'HTML' %} | |
| 14 #include "core/dom/custom/CustomElement.h" | |
| 15 {% endif %} | |
| 13 #include "core/dom/custom/V0CustomElement.h" | 16 #include "core/dom/custom/V0CustomElement.h" |
| 14 #include "core/dom/custom/V0CustomElementRegistrationContext.h" | 17 #include "core/dom/custom/V0CustomElementRegistrationContext.h" |
| 15 #include "core/dom/Document.h" | 18 #include "core/dom/Document.h" |
| 16 #include "core/frame/Settings.h" | 19 #include "core/frame/Settings.h" |
| 17 #include "platform/RuntimeEnabledFeatures.h" | 20 #include "platform/RuntimeEnabledFeatures.h" |
| 18 #include "wtf/HashMap.h" | 21 #include "wtf/HashMap.h" |
| 19 | 22 |
| 20 namespace blink { | 23 namespace blink { |
| 21 | 24 |
| 22 using namespace {{namespace}}Names; | 25 using namespace {{namespace}}Names; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 {% if namespace == 'HTML' %} | 82 {% if namespace == 'HTML' %} |
| 80 HTMLFormElement* formElement, | 83 HTMLFormElement* formElement, |
| 81 {% endif %} | 84 {% endif %} |
| 82 bool createdByParser) | 85 bool createdByParser) |
| 83 { | 86 { |
| 84 if (!g_constructors) | 87 if (!g_constructors) |
| 85 create{{namespace}}FunctionMap(); | 88 create{{namespace}}FunctionMap(); |
| 86 if (ConstructorFunction function = g_constructors->get(localName)) | 89 if (ConstructorFunction function = g_constructors->get(localName)) |
| 87 return function(document, {% if namespace == 'HTML' %}formElement, {% en dif %}createdByParser); | 90 return function(document, {% if namespace == 'HTML' %}formElement, {% en dif %}createdByParser); |
| 88 | 91 |
| 92 {% if namespace == 'HTML' %} | |
| 93 if (CustomElement::shouldCreateCustomElement(document, localName)) | |
|
dominicc (has gone to gerrit)
2016/05/25 05:25:52
:/ this might do things with v0 where they did not
kojii
2016/05/25 05:58:24
Not sure if I understand correctly, but if you're
| |
| 94 return CustomElement::createCustomElement(document, localName); | |
| 95 {% endif %} | |
| 96 | |
| 89 if (document.registrationContext() && V0CustomElement::isValidName(localName )) { | 97 if (document.registrationContext() && V0CustomElement::isValidName(localName )) { |
| 90 Element* element = document.registrationContext()->createCustomTagElemen t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI) ); | 98 Element* element = document.registrationContext()->createCustomTagElemen t(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}NamespaceURI) ); |
| 91 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); | 99 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); |
| 92 return to{{namespace}}Element(element); | 100 return to{{namespace}}Element(element); |
| 93 } | 101 } |
| 94 | 102 |
| 95 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document); | 103 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document); |
| 96 } | 104 } |
| 97 | 105 |
| 98 } // namespace blink | 106 } // namespace blink |
| OLD | NEW |