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

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

Issue 2117143003: Add a fast-path for independent inherited properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@computedstyle_cleanup_rename_final_member_fields
Patch Set: Added useful sizeof check comment Created 4 years, 5 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 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):
11 defaults = { 11 defaults = {
12 'alias_for': None, 12 'alias_for': None,
13 'descriptor_only': None, 13 'descriptor_only': None,
14 'runtime_flag': None, 14 'runtime_flag': None,
15 'longhands': '', 15 'longhands': '',
16 'interpolable': False, 16 'interpolable': False,
17 'inherited': False, 17 'inherited': False,
18 'independent': False,
18 'font': False, 19 'font': False,
19 'svg': False, 20 'svg': False,
20 'name_for_methods': None, 21 'name_for_methods': None,
21 'use_handlers_for': None, 22 'use_handlers_for': None,
22 'getter': None, 23 'getter': None,
23 'setter': None, 24 'setter': None,
25 'isInheritedSetter': None,
Timothy Loh 2016/07/19 01:29:31 Doesn't need to be here if it isn't set from the .
sashab 2016/07/19 03:31:34 Removed.
esprehn 2016/07/19 03:46:26 I think you want is_inherited_setter, but timloh@
24 'initial': None, 26 'initial': None,
25 'type_name': None, 27 'type_name': None,
26 'converter': None, 28 'converter': None,
27 'custom_all': False, 29 'custom_all': False,
28 'custom_initial': False, 30 'custom_initial': False,
29 'custom_inherit': False, 31 'custom_inherit': False,
30 'custom_value': False, 32 'custom_value': False,
31 'builder_skip': False, 33 'builder_skip': False,
32 'direction_aware': False, 34 'direction_aware': False,
33 # Typed OM annotations. 35 # Typed OM annotations.
34 'typedom_types': [], 36 'typedom_types': [],
35 'keywords': [], 37 'keywords': [],
36 'supports_percentage': False, 38 'supports_percentage': False,
37 'supports_multiple': False, 39 'supports_multiple': False,
38 } 40 }
39 41
40 valid_values = { 42 valid_values = {
41 'interpolable': (True, False), 43 'interpolable': (True, False),
42 'inherited': (True, False), 44 'inherited': (True, False),
45 'independent': (True, False),
43 'font': (True, False), 46 'font': (True, False),
44 'svg': (True, False), 47 'svg': (True, False),
45 'custom_all': (True, False), 48 'custom_all': (True, False),
46 'custom_initial': (True, False), 49 'custom_initial': (True, False),
47 'custom_inherit': (True, False), 50 'custom_inherit': (True, False),
48 'custom_value': (True, False), 51 'custom_value': (True, False),
49 'builder_skip': (True, False), 52 'builder_skip': (True, False),
50 'direction_aware': (True, False), 53 'direction_aware': (True, False),
51 } 54 }
52 55
(...skipping 25 matching lines...) Expand all
78 self._properties = {property['property_id']: property for property in pr operties} 81 self._properties = {property['property_id']: property for property in pr operties}
79 82
80 # The generated code will only work with at most one alias per property 83 # The generated code will only work with at most one alias per property
81 assert len({property['alias_for'] for property in self._aliases}) == len (self._aliases) 84 assert len({property['alias_for'] for property in self._aliases}) == len (self._aliases)
82 85
83 for property in self._aliases: 86 for property in self._aliases:
84 property['property_id'] = name_utilities.enum_for_css_property_alias (property['name']) 87 property['property_id'] = name_utilities.enum_for_css_property_alias (property['name'])
85 aliased_property = self._properties[name_utilities.enum_for_css_prop erty(property['alias_for'])] 88 aliased_property = self._properties[name_utilities.enum_for_css_prop erty(property['alias_for'])]
86 property['enum_value'] = aliased_property['enum_value'] + 512 89 property['enum_value'] = aliased_property['enum_value'] + 512
87 self._properties_including_aliases += self._aliases 90 self._properties_including_aliases += self._aliases
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698