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

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

Issue 1814853003: Track whether an element was inserted via document.write (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on #384935 Created 4 years, 8 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
OLDNEW
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 %}
(...skipping 30 matching lines...) Expand all
41 bool createdByParser) 41 bool createdByParser)
42 { 42 {
43 {% if tag.runtimeEnabled %} 43 {% if tag.runtimeEnabled %}
44 if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled()) 44 if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled())
45 return {{fallback_interface}}::create({{tag|symbol}}Tag, document); 45 return {{fallback_interface}}::create({{tag|symbol}}Tag, document);
46 {% endif %} 46 {% endif %}
47 return {{tag.interface}}::create( 47 return {{tag.interface}}::create(
48 {%- if tag.multipleTagNames %}{{tag|symbol}}Tag, {% endif -%} 48 {%- if tag.multipleTagNames %}{{tag|symbol}}Tag, {% endif -%}
49 document 49 document
50 {%- if namespace == 'HTML' and tag.constructorNeedsFormElement %}, formE lement{% endif -%} 50 {%- if namespace == 'HTML' and tag.constructorNeedsFormElement %}, formE lement{% endif -%}
51 {%- if tag.constructorNeedsCreatedByParser %}, createdByParser{% endif - %} 51 {%- if tag.constructorNeedsCreatedByParser %}, createdByParser ? ParserI nserted : DefaultContext{% endif -%}
52 ); 52 );
53 } 53 }
54 {% endfor %} 54 {% endfor %}
55 55
56 struct Create{{namespace}}FunctionMapData { 56 struct Create{{namespace}}FunctionMapData {
57 const QualifiedName& tag; 57 const QualifiedName& tag;
58 ConstructorFunction func; 58 ConstructorFunction func;
59 }; 59 };
60 60
61 static void create{{namespace}}FunctionMap() 61 static void create{{namespace}}FunctionMap()
(...skipping 15 matching lines...) Expand all
77 const AtomicString& localName, 77 const AtomicString& localName,
78 Document& document, 78 Document& document,
79 {% if namespace == 'HTML' %} 79 {% if namespace == 'HTML' %}
80 HTMLFormElement* formElement, 80 HTMLFormElement* formElement,
81 {% endif %} 81 {% endif %}
82 bool createdByParser) 82 bool createdByParser)
83 { 83 {
84 if (!g_constructors) 84 if (!g_constructors)
85 create{{namespace}}FunctionMap(); 85 create{{namespace}}FunctionMap();
86 if (ConstructorFunction function = g_constructors->get(localName)) 86 if (ConstructorFunction function = g_constructors->get(localName))
87 return function(document, {% if namespace == 'HTML' %}formElement, {% en dif %}createdByParser); 87 return function(document, {% if namespace == 'HTML' %}formElement, {% en dif %}createdByParser ? ParserInserted : DefaultContext);
88 88
89 if (document.registrationContext() && CustomElement::isValidName(localName)) { 89 if (document.registrationContext() && CustomElement::isValidName(localName)) {
90 RawPtr<Element> element = document.registrationContext()->createCustomTa gElement(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}Namesp aceURI)); 90 RawPtr<Element> element = document.registrationContext()->createCustomTa gElement(document, QualifiedName(nullAtom, localName, {{namespace_prefix}}Namesp aceURI));
91 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element()); 91 ASSERT_WITH_SECURITY_IMPLICATION(element->is{{namespace}}Element());
92 return static_pointer_cast<{{namespace}}Element>(element.release()); 92 return static_pointer_cast<{{namespace}}Element>(element.release());
93 } 93 }
94 94
95 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document); 95 return {{fallback_interface}}::create(QualifiedName(nullAtom, localName, {{n amespace_prefix}}NamespaceURI), document);
96 } 96 }
97 97
98 } // namespace blink 98 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptLoader.h » ('j') | third_party/WebKit/Source/core/dom/ScriptLoader.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698