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

Unified Diff: Source/build/scripts/make_element_type_helpers.py

Issue 189463005: Generate the isSVG*Element() / toSVG*Element() helper functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove blank line change Created 6 years, 9 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/make_element_type_helpers.py
diff --git a/Source/build/scripts/make_element_type_helpers.py b/Source/build/scripts/make_element_type_helpers.py
index b67d15abf2c165aaf72a5453d96259bcab5f104f..d92ade5d6e5c8851e81670e8fedf0e28b0977e0e 100755
--- a/Source/build/scripts/make_element_type_helpers.py
+++ b/Source/build/scripts/make_element_type_helpers.py
@@ -14,10 +14,18 @@ import template_expander
from in_file import InFile
+def _symbol(tag):
+ # FIXME: Remove this special case for the ugly x-webkit-foo attributes.
+ if tag['name'].startswith('-webkit-'):
+ return tag['name'].replace('-', '_')[1:]
+ return name_utilities.cpp_name(tag).replace('-', '_')
+
class MakeElementTypeHelpersWriter(in_generator.Writer):
defaults = {
'interfaceName': None,
'noConstructor': None,
+ 'noTypeHelpers': None,
+ 'ImplementedAs': None,
'JSInterfaceName': None,
'constructorNeedsCreatedByParser': None,
'constructorNeedsFormElement': None,
@@ -36,6 +44,7 @@ class MakeElementTypeHelpersWriter(in_generator.Writer):
}
filters = {
'hash': hasher.hash,
+ 'symbol': _symbol,
}
def __init__(self, in_file_path):
« no previous file with comments | « Source/build/scripts/make_element_factory.py ('k') | Source/build/scripts/templates/ElementTypeHelpers.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698