| OLD | NEW |
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 'boolean': 'fastHasAttribute', | 246 'boolean': 'fastHasAttribute', |
| 247 'long': 'getIntegralAttribute', | 247 'long': 'getIntegralAttribute', |
| 248 'unsigned long': 'getUnsignedIntegralAttribute', | 248 'unsigned long': 'getUnsignedIntegralAttribute', |
| 249 } | 249 } |
| 250 | 250 |
| 251 | 251 |
| 252 def getter_base_name(interface, attribute, arguments): | 252 def getter_base_name(interface, attribute, arguments): |
| 253 extended_attributes = attribute.extended_attributes | 253 extended_attributes = attribute.extended_attributes |
| 254 | 254 |
| 255 if 'ImplementedInPrivateScript' in extended_attributes: | 255 if 'ImplementedInPrivateScript' in extended_attributes: |
| 256 return '%sAttributeGetterImplementedInPrivateScript' % uncapitalize(cpp_
name(attribute)) | 256 return '%sAttributeGetter' % uncapitalize(cpp_name(attribute)) |
| 257 | 257 |
| 258 if 'Reflect' not in extended_attributes: | 258 if 'Reflect' not in extended_attributes: |
| 259 return uncapitalize(cpp_name(attribute)) | 259 return uncapitalize(cpp_name(attribute)) |
| 260 | 260 |
| 261 content_attribute_name = extended_attributes['Reflect'] or attribute.name.lo
wer() | 261 content_attribute_name = extended_attributes['Reflect'] or attribute.name.lo
wer() |
| 262 if content_attribute_name in ['class', 'id', 'name']: | 262 if content_attribute_name in ['class', 'id', 'name']: |
| 263 # Special-case for performance optimization. | 263 # Special-case for performance optimization. |
| 264 return 'get%sAttribute' % content_attribute_name.capitalize() | 264 return 'get%sAttribute' % content_attribute_name.capitalize() |
| 265 | 265 |
| 266 arguments.append(scoped_content_attribute_name(interface, attribute)) | 266 arguments.append(scoped_content_attribute_name(interface, attribute)) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 | 391 |
| 392 CONTENT_ATTRIBUTE_SETTER_NAMES = { | 392 CONTENT_ATTRIBUTE_SETTER_NAMES = { |
| 393 'boolean': 'setBooleanAttribute', | 393 'boolean': 'setBooleanAttribute', |
| 394 'long': 'setIntegralAttribute', | 394 'long': 'setIntegralAttribute', |
| 395 'unsigned long': 'setUnsignedIntegralAttribute', | 395 'unsigned long': 'setUnsignedIntegralAttribute', |
| 396 } | 396 } |
| 397 | 397 |
| 398 | 398 |
| 399 def setter_base_name(interface, attribute, arguments): | 399 def setter_base_name(interface, attribute, arguments): |
| 400 if 'ImplementedInPrivateScript' in attribute.extended_attributes: | 400 if 'ImplementedInPrivateScript' in attribute.extended_attributes: |
| 401 return '%sAttributeSetterImplementedInPrivateScript' % uncapitalize(cpp_
name(attribute)) | 401 return '%sAttributeSetter' % uncapitalize(cpp_name(attribute)) |
| 402 | 402 |
| 403 if 'Reflect' not in attribute.extended_attributes: | 403 if 'Reflect' not in attribute.extended_attributes: |
| 404 return 'set%s' % capitalize(cpp_name(attribute)) | 404 return 'set%s' % capitalize(cpp_name(attribute)) |
| 405 arguments.append(scoped_content_attribute_name(interface, attribute)) | 405 arguments.append(scoped_content_attribute_name(interface, attribute)) |
| 406 | 406 |
| 407 base_idl_type = attribute.idl_type.base_type | 407 base_idl_type = attribute.idl_type.base_type |
| 408 if base_idl_type in CONTENT_ATTRIBUTE_SETTER_NAMES: | 408 if base_idl_type in CONTENT_ATTRIBUTE_SETTER_NAMES: |
| 409 return CONTENT_ATTRIBUTE_SETTER_NAMES[base_idl_type] | 409 return CONTENT_ATTRIBUTE_SETTER_NAMES[base_idl_type] |
| 410 return 'setAttribute' | 410 return 'setAttribute' |
| 411 | 411 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 lambda self: strip_suffix(self.base_type, 'Constructor')) | 482 lambda self: strip_suffix(self.base_type, 'Constructor')) |
| 483 | 483 |
| 484 | 484 |
| 485 def is_constructor_attribute(attribute): | 485 def is_constructor_attribute(attribute): |
| 486 # FIXME: replace this with [ConstructorAttribute] extended attribute | 486 # FIXME: replace this with [ConstructorAttribute] extended attribute |
| 487 return attribute.idl_type.base_type.endswith('Constructor') | 487 return attribute.idl_type.base_type.endswith('Constructor') |
| 488 | 488 |
| 489 | 489 |
| 490 def constructor_getter_context(interface, attribute, context): | 490 def constructor_getter_context(interface, attribute, context): |
| 491 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] | 491 context['needs_constructor_getter_callback'] = context['measure_as'] or cont
ext['deprecate_as'] |
| OLD | NEW |