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

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

Issue 60763002: Never create HTMLTrackElement when VideoTrack is not enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: consistency 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
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 25 matching lines...) Expand all
36 36
37 {%- for tag in tags|sort if not tag.mapToTagName and not tag.noConstructor %} 37 {%- for tag in tags|sort if not tag.mapToTagName and not tag.noConstructor %}
38 static PassRefPtr<{{namespace}}Element> {{tag|symbol}}Constructor( 38 static PassRefPtr<{{namespace}}Element> {{tag|symbol}}Constructor(
39 const QualifiedName& tagName, 39 const QualifiedName& tagName,
40 Document& document, 40 Document& document,
41 {%- if namespace == 'HTML' %} 41 {%- if namespace == 'HTML' %}
42 HTMLFormElement* formElement, 42 HTMLFormElement* formElement,
43 {%- endif %} 43 {%- endif %}
44 bool createdByParser) 44 bool createdByParser)
45 { 45 {
46 {%- if tag.wrapperOnlyIfMediaIsAvailable %} 46 {%- if tag.contextConditional %}
47 Settings* settings = document.settings(); 47 if (!ContextFeatures::{{tag.contextConditional}}Enabled(&document))
48 if (!RuntimeEnabledFeatures::mediaEnabled() || (settings && !settings->media Enabled()))
49 return 0; 48 return 0;
50 {%- endif %} 49 {%- endif %}
51 {%- if tag.contextConditional %} 50 {%- if tag.runtimeEnabled %}
52 if (!ContextFeatures::{{tag.contextConditional}}Enabled(&document)) 51 if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled())
53 return 0; 52 return 0;
54 {%- endif %} 53 {%- endif %}
55 return {{tag.interface}}::create(tagName, document 54 return {{tag.interface}}::create(tagName, document
56 {%- if namespace == 'HTML' and tag.constructorNeedsFormElement %}, formElement{% endif -%} 55 {%- if namespace == 'HTML' and tag.constructorNeedsFormElement %}, formElement{% endif -%}
57 {%- if tag.constructorNeedsCreatedByParser %}, createdByParser{% endif -%} 56 {%- if tag.constructorNeedsCreatedByParser %}, createdByParser{% endif -%}
58 ); 57 );
59 } 58 }
60 {%- endfor %} 59 {%- endfor %}
61 60
62 {%- for tag in tags|sort if tag.mapToTagName %} 61 {%- for tag in tags|sort if tag.mapToTagName %}
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 *document, 103 *document,
105 {%- if namespace == 'HTML' %}formElement,{% endif %} 104 {%- if namespace == 'HTML' %}formElement,{% endif %}
106 createdByParser) ) 105 createdByParser) )
107 return element; 106 return element;
108 } 107 }
109 108
110 return {{fallback_interface}}::create(qName, *document); 109 return {{fallback_interface}}::create(qName, *document);
111 } 110 }
112 111
113 } // namespace WebCore 112 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/build/scripts/make_element_factory.py ('k') | Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698