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++) |