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

Unified Diff: Source/build/scripts/templates/ElementTypeHelpers.h.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/ElementTypeHelpers.h.tmpl
diff --git a/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl b/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl
index 3a66987a5491fc97c5c0e5bd02b95e77074d683d..50bad514bad3e002a1d9cd2cf1fa9f7823ac9cb1 100644
--- a/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl
+++ b/Source/build/scripts/templates/ElementTypeHelpers.h.tmpl
@@ -12,6 +12,7 @@
namespace WebCore {
// Type checking.
{% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %}
+{% filter enable_conditional(tag.Conditional) %}
class {{tag.interface}};
void is{{tag.interface}}(const {{tag.interface}}&); // Catch unnecessary runtime check of type known at compile time.
void is{{tag.interface}}(const {{tag.interface}}*); // Catch unnecessary runtime check of type known at compile time.
@@ -51,13 +52,15 @@ template <> inline bool isElementOfType<const {{tag.interface}}>(const Element&
{% if namespace == "HTML" %}
template <> inline bool isElementOfType<const {{tag.interface}}>(const HTMLElement& element) { return is{{tag.interface}}(element); }
{% endif %}
-
+{% endfilter %}
{% endfor %}
// Using macros because the types are forward-declared and we don't want to use reinterpret_cast in the
// casting functions above. reinterpret_cast would be unsafe due to multiple inheritence.
{% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %}
+{% filter enable_conditional(tag.Conditional) %}
#define to{{tag.interface}}(x) WebCore::toElement<WebCore::{{tag.interface}}>(x)
+{% endfilter %}
{% endfor %}
} // WebCore
« no previous file with comments | « Source/build/scripts/templates/ElementFactory.cpp.tmpl ('k') | Source/build/scripts/templates/ElementWrapperFactory.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698