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

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

Issue 35423004: Move SVGNames to Python (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add comment Created 7 years, 2 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
« no previous file with comments | « Source/build/scripts/name_utilities.py ('k') | Source/build/scripts/templates/ElementFactory.h.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6f2bd4e682abf66f281923edaff8bb47ca53a15b..09322d282155d4ac7d06d19bb79b62fcb61236ba 100644
--- a/Source/build/scripts/templates/ElementFactory.cpp.tmpl
+++ b/Source/build/scripts/templates/ElementFactory.cpp.tmpl
@@ -7,7 +7,7 @@
#include "RuntimeEnabledFeatures.h"
#include "{{namespace}}Names.h"
{%- for tag in tags|sort %}
-#include "core/{{namespace|lower}}/{{tag|interface}}.h"
+#include "core/{{namespace|lower}}/{{tag.interface}}.h"
{%- endfor %}
{%- if fallback_interface %}
#include "core/{{namespace|lower}}/{{fallback_interface}}.h"
@@ -23,13 +23,25 @@ namespace WebCore {
using namespace {{namespace}}Names;
-typedef PassRefPtr<{{namespace}}Element> (*ConstructorFunction)(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
+typedef PassRefPtr<{{namespace}}Element> (*ConstructorFunction)(const QualifiedName&,
+ Document&,
+ {%- if namespace == 'HTML' %}
+ HTMLFormElement*,
+ {%- endif %}
+ bool createdByParser);
+
typedef HashMap<StringImpl*, ConstructorFunction> FunctionMap;
static FunctionMap* g_constructors = 0;
{%- for tag in tags|sort if not tag.mapToTagName and not tag.noConstructor %}
-static PassRefPtr<{{namespace}}Element> {{tag|symbol}}Constructor(const QualifiedName& tagName, Document& document, HTMLFormElement* formElement, bool createdByParser)
+static PassRefPtr<{{namespace}}Element> {{tag|symbol}}Constructor(
+ const QualifiedName& tagName,
+ Document& document,
+{%- if namespace == 'HTML' %}
+ HTMLFormElement* formElement,
+{%- endif %}
+ bool createdByParser)
{
{%- if tag.wrapperOnlyIfMediaIsAvailable %}
Settings* settings = document.settings();
@@ -40,8 +52,8 @@ static PassRefPtr<{{namespace}}Element> {{tag|symbol}}Constructor(const Qualifie
if (!ContextFeatures::{{tag.contextConditional}}Enabled(&document))
return 0;
{%- endif %}
- return {{tag|interface}}::create(tagName, document
-{%- if tag.constructorNeedsFormElement %}, formElement{% endif -%}
+ return {{tag.interface}}::create(tagName, document
+{%- if namespace == 'HTML' and tag.constructorNeedsFormElement %}, formElement{% endif -%}
{%- if tag.constructorNeedsCreatedByParser %}, createdByParser{% endif -%}
);
}
@@ -68,7 +80,13 @@ static void createFunctionMap()
{%- endfor %}
}
-PassRefPtr<{{namespace}}Element> {{namespace}}ElementFactory::create{{namespace}}Element(const QualifiedName& qName, Document* document, HTMLFormElement* formElement, bool createdByParser)
+PassRefPtr<{{namespace}}Element> {{namespace}}ElementFactory::create{{namespace}}Element(
+ const QualifiedName& qName,
+ Document* document,
+{%- if namespace == 'HTML' %}
+ HTMLFormElement* formElement,
+{%- endif %}
+ bool createdByParser)
{
if (!document)
return 0;
@@ -82,7 +100,10 @@ PassRefPtr<{{namespace}}Element> {{namespace}}ElementFactory::create{{namespace}
if (!g_constructors)
createFunctionMap();
if (ConstructorFunction function = g_constructors->get(qName.localName().impl())) {
- if (PassRefPtr<{{namespace}}Element> element = function(qName, *document, formElement, createdByParser))
+ if (PassRefPtr<{{namespace}}Element> element = function(qName,
+ *document,
+ {%- if namespace == 'HTML' %}formElement,{% endif %}
+ createdByParser))
return element;
}
« no previous file with comments | « Source/build/scripts/name_utilities.py ('k') | Source/build/scripts/templates/ElementFactory.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698