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

Unified Diff: Source/build/scripts/templates/ElementFactory.cpp.tmpl

Issue 330093002: Add support in generate scripts to handle Conditional (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sort by alpha Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/build/scripts/templates/ElementFactory.cpp.tmpl
diff --git a/Source/build/scripts/templates/ElementFactory.cpp.tmpl b/Source/build/scripts/templates/ElementFactory.cpp.tmpl
index cc439824fd1d0850f123cabc54ab63f86afc47f8..183de26db325d944de9350422dfc1d6349ea1d13 100644
--- a/Source/build/scripts/templates/ElementFactory.cpp.tmpl
+++ b/Source/build/scripts/templates/ElementFactory.cpp.tmpl
@@ -35,6 +35,7 @@ typedef HashMap<AtomicString, ConstructorFunction> FunctionMap;
static FunctionMap* g_constructors = 0;
{% for tag in tags|sort if not tag.noConstructor %}
+{% filter enable_conditional(tag.Conditional) %}
static PassRefPtrWillBeRawPtr<{{namespace}}Element> {{tag|symbol}}Constructor(
Document& document,
{% if namespace == 'HTML' %}
@@ -57,6 +58,7 @@ static PassRefPtrWillBeRawPtr<{{namespace}}Element> {{tag|symbol}}Constructor(
{%- if tag.constructorNeedsCreatedByParser %}, createdByParser{% endif -%}
);
}
+{% endfilter %}
{% endfor %}
struct Create{{namespace}}FunctionMapData {
@@ -68,9 +70,13 @@ static void create{{namespace}}FunctionMap()
{
ASSERT(!g_constructors);
g_constructors = new FunctionMap;
+ // Empty array initializer lists are illegal [dcl.init.aggr] and will not
+ // compile in MSVC. If tags list is empty, add check to skip this.
static const Create{{namespace}}FunctionMapData data[] = {
{% for tag in tags|sort if not tag.noConstructor %}
+ {% filter enable_conditional(tag.Conditional) %}
{ {{tag|symbol}}Tag, {{tag|symbol}}Constructor },
+ {% endfilter %}
{% endfor %}
};
for (size_t i = 0; i < WTF_ARRAY_LENGTH(data); i++)
« no previous file with comments | « Source/build/scripts/make_qualified_names.py ('k') | Source/build/scripts/templates/ElementTypeHelpers.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698