Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: sky/engine/build/scripts/templates/ElementFactory.cpp.tmpl

Issue 942933003: Remove almost all clients of isHTMLElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sky/engine/build/scripts/templates/ElementFactory.h.tmpl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | sky/engine/build/scripts/templates/ElementFactory.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698