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

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

Issue 69533003: Upgrade parser-created Custom Elements in creation order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring patch to head. Created 7 years, 1 month 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 | Annotate | Revision Log
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 "RuntimeEnabledFeatures.h" 7 #include "RuntimeEnabledFeatures.h"
8 #include "{{namespace}}Names.h" 8 #include "{{namespace}}Names.h"
9 {%- for tag in tags|sort %} 9 {%- for tag in tags|sort %}
10 #include "core/{{namespace|lower}}/{{tag.interface}}.h" 10 #include "core/{{namespace|lower}}/{{tag.interface}}.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 PassRefPtr<{{namespace}}Element> {{namespace}}ElementFactory::create{{namespace} }Element( 75 PassRefPtr<{{namespace}}Element> {{namespace}}ElementFactory::create{{namespace} }Element(
76 const AtomicString& localName, 76 const AtomicString& localName,
77 Document& document, 77 Document& document,
78 {%- if namespace == 'HTML' %} 78 {%- if namespace == 'HTML' %}
79 HTMLFormElement* formElement, 79 HTMLFormElement* formElement,
80 {%- endif %} 80 {%- endif %}
81 bool createdByParser) 81 bool createdByParser)
82 { 82 {
83 if (CustomElement::isValidName(localName) && document.registrationContext()) { 83 if (CustomElement::isValidName(localName) && document.registrationContext()) {
84 RefPtr<Element> element = document.registrationContext()->createCustomTa gElement(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}Namesp aceURI), createdByParser ? CustomElementRegistrationContext::CreatedByParser : C ustomElementRegistrationContext::NotCreatedByParser); 84 RefPtr<Element> element = document.registrationContext()->createCustomTa gElement(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}Namesp aceURI));
85 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); 85 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element());
86 return static_pointer_cast<{{namespace}}Element>(element.release()); 86 return static_pointer_cast<{{namespace}}Element>(element.release());
87 } 87 }
88 88
89 if (!g_constructors) 89 if (!g_constructors)
90 createFunctionMap(); 90 createFunctionMap();
91 if (ConstructorFunction function = g_constructors->get(localName)) 91 if (ConstructorFunction function = g_constructors->get(localName))
92 return function(document, {%- if namespace == 'HTML' %}formElement,{% en dif %} createdByParser); 92 return function(document, {%- if namespace == 'HTML' %}formElement,{% en dif %} createdByParser);
93 93
94 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document); 94 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document);
95 } 95 }
96 96
97 } // namespace WebCore 97 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/custom/lifecycle-created-innerHTML-expected.txt ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698