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

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

Issue 841873006: All documents should have a RegistrationContext. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/core/dom/Document.h » ('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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 PassRefPtr<{{namespace}}Element> {{namespace}}ElementFactory::create{{namespace} }Element( 74 PassRefPtr<{{namespace}}Element> {{namespace}}ElementFactory::create{{namespace} }Element(
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 (document.registrationContext() && CustomElement::isValidName(localName)) { 84 if (CustomElement::isValidName(localName)) {
85 RefPtr<Element> element = document.registrationContext()->createCustomTa gElement(document, QualifiedName(localName)); 85 RefPtr<Element> element = document.registrationContext().createCustomTag Element(document, QualifiedName(localName));
86 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); 86 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element());
87 return static_pointer_cast<{{namespace}}Element>(element.release()); 87 return static_pointer_cast<{{namespace}}Element>(element.release());
88 } 88 }
89 89
90 return {{fallback_interface}}::create(QualifiedName(localName), document); 90 return {{fallback_interface}}::create(QualifiedName(localName), document);
91 } 91 }
92 92
93 } // namespace blink 93 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698