| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import in_generator | 6 import in_generator |
| 7 from name_utilities import lower_first | 7 from name_utilities import lower_first |
| 8 | 8 |
| 9 | 9 |
| 10 class CSSProperties(in_generator.Writer): | 10 class CSSProperties(in_generator.Writer): |
| 11 defaults = { | 11 defaults = { |
| 12 'alias_for': None, | 12 'alias_for': None, |
| 13 'longhands': '', | 13 'longhands': '', |
| 14 'animatable': False, | 14 'animatable': False, |
| 15 'inherited': False, |
| 15 'font': False, | 16 'font': False, |
| 16 'svg': False, | 17 'svg': False, |
| 17 'name_for_methods': None, | 18 'name_for_methods': None, |
| 18 'use_handlers_for': None, | 19 'use_handlers_for': None, |
| 19 'getter': None, | 20 'getter': None, |
| 20 'setter': None, | 21 'setter': None, |
| 21 'initial': None, | 22 'initial': None, |
| 22 'type_name': None, | 23 'type_name': None, |
| 23 'converter': None, | 24 'converter': None, |
| 24 'custom_all': False, | 25 'custom_all': False, |
| 25 'custom_initial': False, | 26 'custom_initial': False, |
| 26 'custom_inherit': False, | 27 'custom_inherit': False, |
| 27 'custom_value': False, | 28 'custom_value': False, |
| 28 'builder_skip': False, | 29 'builder_skip': False, |
| 29 'direction_aware': False, | 30 'direction_aware': False, |
| 30 } | 31 } |
| 31 | 32 |
| 32 valid_values = { | 33 valid_values = { |
| 33 'animatable': (True, False), | 34 'animatable': (True, False), |
| 35 'inherited': (True, False), |
| 34 'font': (True, False), | 36 'font': (True, False), |
| 35 'svg': (True, False), | 37 'svg': (True, False), |
| 36 'custom_all': (True, False), | 38 'custom_all': (True, False), |
| 37 'custom_initial': (True, False), | 39 'custom_initial': (True, False), |
| 38 'custom_inherit': (True, False), | 40 'custom_inherit': (True, False), |
| 39 'custom_value': (True, False), | 41 'custom_value': (True, False), |
| 40 'builder_skip': (True, False), | 42 'builder_skip': (True, False), |
| 41 'direction_aware': (True, False), | 43 'direction_aware': (True, False), |
| 42 } | 44 } |
| 43 | 45 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 66 def camelcase_css_name(css_name): | 68 def camelcase_css_name(css_name): |
| 67 """Convert hyphen-separated-name to UpperCamelCase. | 69 """Convert hyphen-separated-name to UpperCamelCase. |
| 68 | 70 |
| 69 E.g., '-foo-bar' becomes 'FooBar'. | 71 E.g., '-foo-bar' becomes 'FooBar'. |
| 70 """ | 72 """ |
| 71 return ''.join(word.capitalize() for word in css_name.split('-')) | 73 return ''.join(word.capitalize() for word in css_name.split('-')) |
| 72 | 74 |
| 73 | 75 |
| 74 def css_name_to_enum(css_name): | 76 def css_name_to_enum(css_name): |
| 75 return 'CSSProperty' + camelcase_css_name(css_name) | 77 return 'CSSProperty' + camelcase_css_name(css_name) |
| OLD | NEW |