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

Side by Side Diff: third_party/WebKit/Source/build/scripts/css_properties.py

Issue 2567473002: Made a generator for CSSPropertyDescriptor.cpp (Closed)
Patch Set: fixed some formatting Created 4 years 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 unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 'setter': None, 24 'setter': None,
25 'initial': None, 25 'initial': None,
26 'type_name': None, 26 'type_name': None,
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 'api_class': None,
34 # Typed OM annotations. 35 # Typed OM annotations.
35 'typedom_types': [], 36 'typedom_types': [],
36 'keywords': [], 37 'keywords': [],
37 'initial_keyword': None, 38 'initial_keyword': None,
38 'keyword_only': False, 39 'keyword_only': False,
39 'supports_percentage': False, 40 'supports_percentage': False,
40 'repeated': False, 41 'repeated': False,
41 } 42 }
42 43
43 valid_values = { 44 valid_values = {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 self._properties = {property['property_id']: property for property in pr operties} 84 self._properties = {property['property_id']: property for property in pr operties}
84 85
85 # The generated code will only work with at most one alias per property 86 # The generated code will only work with at most one alias per property
86 assert len({property['alias_for'] for property in self._aliases}) == len (self._aliases) 87 assert len({property['alias_for'] for property in self._aliases}) == len (self._aliases)
87 88
88 for property in self._aliases: 89 for property in self._aliases:
89 property['property_id'] = name_utilities.enum_for_css_property_alias (property['name']) 90 property['property_id'] = name_utilities.enum_for_css_property_alias (property['name'])
90 aliased_property = self._properties[name_utilities.enum_for_css_prop erty(property['alias_for'])] 91 aliased_property = self._properties[name_utilities.enum_for_css_prop erty(property['alias_for'])]
91 property['enum_value'] = aliased_property['enum_value'] + 512 92 property['enum_value'] = aliased_property['enum_value'] + 512
92 self._properties_including_aliases += self._aliases 93 self._properties_including_aliases += self._aliases
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698