Chromium Code Reviews| 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..722fe9be4dbd3d59532e8359927d1c7a9d12faca 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; |
| + // FIXME: Compilation on MSVC will fail if data[] is empty. Zero size arrays |
|
Nils Barth (inactive)
2014/06/16 06:27:52
I wouldn't make this a FIXME;
it's fine to just ha
|
| + // not allowed in MSVC. Make sure tags list is not empty. |
| 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++) |