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 import name_utilities | 7 import name_utilities |
8 | 8 |
9 | 9 |
10 class CSSProperties(in_generator.Writer): | 10 class CSSProperties(in_generator.Writer): |
(...skipping 16 matching lines...) Expand all Loading... |
27 'converter': None, | 27 'converter': None, |
28 'custom_all': False, | 28 'custom_all': False, |
29 'custom_initial': False, | 29 'custom_initial': False, |
30 'custom_inherit': False, | 30 'custom_inherit': False, |
31 'custom_value': False, | 31 'custom_value': False, |
32 'builder_skip': False, | 32 'builder_skip': False, |
33 'direction_aware': False, | 33 'direction_aware': False, |
34 # Typed OM annotations. | 34 # Typed OM annotations. |
35 'typedom_types': [], | 35 'typedom_types': [], |
36 'keywords': [], | 36 'keywords': [], |
| 37 'initial_keyword': None, |
37 'keyword_only': False, | 38 'keyword_only': False, |
38 'supports_percentage': False, | 39 'supports_percentage': False, |
39 'supports_multiple': False, | 40 'supports_multiple': False, |
40 } | 41 } |
41 | 42 |
42 valid_values = { | 43 valid_values = { |
43 'interpolable': (True, False), | 44 'interpolable': (True, False), |
44 'inherited': (True, False), | 45 'inherited': (True, False), |
45 'independent': (True, False), | 46 'independent': (True, False), |
46 'font': (True, False), | 47 'font': (True, False), |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 self._properties = {property['property_id']: property for property in pr
operties} | 83 self._properties = {property['property_id']: property for property in pr
operties} |
83 | 84 |
84 # The generated code will only work with at most one alias per property | 85 # The generated code will only work with at most one alias per property |
85 assert len({property['alias_for'] for property in self._aliases}) == len
(self._aliases) | 86 assert len({property['alias_for'] for property in self._aliases}) == len
(self._aliases) |
86 | 87 |
87 for property in self._aliases: | 88 for property in self._aliases: |
88 property['property_id'] = name_utilities.enum_for_css_property_alias
(property['name']) | 89 property['property_id'] = name_utilities.enum_for_css_property_alias
(property['name']) |
89 aliased_property = self._properties[name_utilities.enum_for_css_prop
erty(property['alias_for'])] | 90 aliased_property = self._properties[name_utilities.enum_for_css_prop
erty(property['alias_for'])] |
90 property['enum_value'] = aliased_property['enum_value'] + 512 | 91 property['enum_value'] = aliased_property['enum_value'] + 512 |
91 self._properties_including_aliases += self._aliases | 92 self._properties_including_aliases += self._aliases |
OLD | NEW |