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

Unified Diff: Source/bindings/scripts/unstable/v8_attributes.py

Issue 177143002: IDL compiler: SVGNames (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/unstable/v8_attributes.py
diff --git a/Source/bindings/scripts/unstable/v8_attributes.py b/Source/bindings/scripts/unstable/v8_attributes.py
index 091b47e29359a19dfd0d6bde579b484969761aef..98e8eec2a36eeb4d8cae1a1d1333bfbdff2154b4 100644
--- a/Source/bindings/scripts/unstable/v8_attributes.py
+++ b/Source/bindings/scripts/unstable/v8_attributes.py
@@ -192,7 +192,7 @@ def generate_getter(interface, attribute, contents):
def getter_expression(interface, attribute, contents):
arguments = []
- this_getter_base_name = getter_base_name(attribute, arguments)
+ this_getter_base_name = getter_base_name(interface, attribute, arguments)
getter_name = v8_utilities.scoped_name(interface, attribute, this_getter_base_name)
arguments.extend(v8_utilities.call_with_arguments(attribute))
@@ -213,7 +213,7 @@ CONTENT_ATTRIBUTE_GETTER_NAMES = {
}
-def getter_base_name(attribute, arguments):
+def getter_base_name(interface, attribute, arguments):
extended_attributes = attribute.extended_attributes
if 'Reflect' not in extended_attributes:
return uncapitalize(cpp_name(attribute))
@@ -223,7 +223,7 @@ def getter_base_name(attribute, arguments):
# Special-case for performance optimization.
return 'get%sAttribute' % content_attribute_name.capitalize()
- arguments.append(scoped_content_attribute_name(attribute))
+ arguments.append(scoped_content_attribute_name(interface, attribute))
idl_type = attribute.idl_type
if idl_type in CONTENT_ATTRIBUTE_GETTER_NAMES:
@@ -289,7 +289,7 @@ def setter_expression(interface, attribute, contents):
extended_attributes = attribute.extended_attributes
arguments = v8_utilities.call_with_arguments(attribute, extended_attributes.get('SetterCallWith'))
- this_setter_base_name = setter_base_name(attribute, arguments)
+ this_setter_base_name = setter_base_name(interface, attribute, arguments)
setter_name = v8_utilities.scoped_name(interface, attribute, this_setter_base_name)
if ('ImplementedBy' in extended_attributes and
@@ -324,10 +324,10 @@ CONTENT_ATTRIBUTE_SETTER_NAMES = {
}
-def setter_base_name(attribute, arguments):
+def setter_base_name(interface, attribute, arguments):
if 'Reflect' not in attribute.extended_attributes:
return 'set%s' % capitalize(cpp_name(attribute))
- arguments.append(scoped_content_attribute_name(attribute))
+ arguments.append(scoped_content_attribute_name(interface, attribute))
idl_type = attribute.idl_type
if idl_type in CONTENT_ATTRIBUTE_SETTER_NAMES:
@@ -335,9 +335,9 @@ def setter_base_name(attribute, arguments):
return 'setAttribute'
-def scoped_content_attribute_name(attribute):
+def scoped_content_attribute_name(interface, attribute):
content_attribute_name = attribute.extended_attributes['Reflect'] or attribute.name.lower()
- namespace = 'HTMLNames' # FIXME: can be SVG too
+ namespace = 'SVGNames' if interface.name.startswith('SVG') else 'HTMLNames'
kouhei (in TOK) 2014/02/24 07:24:25 What happens for XMLNames and XLinkNames?
Nils Barth (inactive) 2014/02/24 07:27:52 They don't occur in bindings: only HTMLNames and (
haraken 2014/02/24 07:36:26 I guess we have a plan to remove the namespace dis
Nils Barth (inactive) 2014/02/24 07:37:40 I'll see if we can fix this during cleanup, or at
includes.add('%s.h' % namespace)
return '%s::%sAttr' % (namespace, content_attribute_name)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698