| OLD | NEW |
| 1 {% from "macros.tmpl" import license %} | 1 {% from "macros.tmpl" import license %} |
| 2 {{ license() }} | 2 {{ license() }} |
| 3 | 3 |
| 4 #include "config.h" | 4 #include "config.h" |
| 5 #include "{{namespace}}ElementFactory.h" | 5 #include "{{namespace}}ElementFactory.h" |
| 6 | 6 |
| 7 #include "{{namespace}}Names.h" | 7 #include "{{namespace}}Names.h" |
| 8 {% for tag in tags|sort %} | 8 {% for tag in tags|sort %} |
| 9 #include "core/{{namespace|lower}}/{{tag.interface}}.h" | 9 #include "core/{{namespace|lower}}/{{tag.interface}}.h" |
| 10 {% endfor %} | 10 {% endfor %} |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 {% for tag in tags|sort if not tag.noConstructor %} | 64 {% for tag in tags|sort if not tag.noConstructor %} |
| 65 {% filter enable_conditional(tag.Conditional) %} | 65 {% filter enable_conditional(tag.Conditional) %} |
| 66 { {{tag|symbol}}Tag, {{tag|symbol}}Constructor }, | 66 { {{tag|symbol}}Tag, {{tag|symbol}}Constructor }, |
| 67 {% endfilter %} | 67 {% endfilter %} |
| 68 {% endfor %} | 68 {% endfor %} |
| 69 }; | 69 }; |
| 70 for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++) | 70 for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++) |
| 71 g_constructors->set(data[i].tag.localName(), data[i].func); | 71 g_constructors->set(data[i].tag.localName(), data[i].func); |
| 72 } | 72 } |
| 73 | 73 |
| 74 PassRefPtr<{{namespace}}Element> {{namespace}}ElementFactory::create{{namespace}
}Element( | 74 PassRefPtr<Element> {{namespace}}ElementFactory::createElement( |
| 75 const AtomicString& localName, | 75 const AtomicString& localName, |
| 76 Document& document, | 76 Document& document, |
| 77 bool createdByParser) | 77 bool createdByParser) |
| 78 { | 78 { |
| 79 if (!g_constructors) | 79 if (!g_constructors) |
| 80 create{{namespace}}FunctionMap(); | 80 create{{namespace}}FunctionMap(); |
| 81 if (ConstructorFunction function = g_constructors->get(localName)) | 81 if (ConstructorFunction function = g_constructors->get(localName)) |
| 82 return function(document, createdByParser); | 82 return function(document, createdByParser); |
| 83 | 83 |
| 84 if (CustomElement::isValidName(localName)) { | 84 if (CustomElement::isValidName(localName)) |
| 85 RefPtr<Element> element = document.registrationContext().createCustomTag
Element(document, QualifiedName(localName)); | 85 return document.registrationContext().createCustomTagElement(document, Q
ualifiedName(localName)); |
| 86 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); | |
| 87 return static_pointer_cast<{{namespace}}Element>(element.release()); | |
| 88 } | |
| 89 | 86 |
| 90 return {{fallback_interface}}::create(QualifiedName(localName), document); | 87 return {{fallback_interface}}::create(QualifiedName(localName), document); |
| 91 } | 88 } |
| 92 | 89 |
| 93 } // namespace blink | 90 } // namespace blink |
| OLD | NEW |