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

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

Issue 2676513002: Generate nonproperty 'variableReference' in ComputedStyleBase. (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 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 math 6 import math
7 import sys 7 import sys
8 8
9 import json5_generator 9 import json5_generator
10 import template_expander 10 import template_expander
11 import make_style_builder 11 import make_style_builder
12 12
13 from name_utilities import camel_case, lower_first, upper_first_letter, enum_for _css_keyword 13 from name_utilities import camel_case, lower_first, upper_first_letter, enum_for _css_keyword
14 14
15 15
16 # Temporary hard-coded list of fields that are not CSS properties. 16 # Temporary hard-coded list of fields that are not CSS properties.
17 # Ideally these would be specified in a .in or .json5 file. 17 # Ideally these would be specified in a .in or .json5 file.
18 NONPROPERTY_FIELDS = set([ 18 NONPROPERTY_FIELDS = set([
19 # Style can not be shared. 19 # Style can not be shared.
20 'unique', 20 'unique',
21 # Whether this style is affected by these pseudo-classes. 21 # Whether this style is affected by these pseudo-classes.
22 'affectedByFocus', 22 'affectedByFocus',
23 'affectedByHover', 23 'affectedByHover',
24 'affectedByActive', 24 'affectedByActive',
25 'affectedByDrag', 25 'affectedByDrag',
26 # A non-inherited property references a variable or @apply is used
27 'hasVariableReferenceFromNonInheritedProperty',
26 ]) 28 ])
27 29
28 30
29 class Field(object): 31 class Field(object):
30 """ 32 """
31 The generated ComputedStyle object is made up of a series of Fields. 33 The generated ComputedStyle object is made up of a series of Fields.
32 Each Field has a name, size, type, etc, and a bunch of attributes to 34 Each Field has a name, size, type, etc, and a bunch of attributes to
33 determine which methods it will be used in. 35 determine which methods it will be used in.
34 36
35 A Field also has enough information to use any storage type in C++, such as 37 A Field also has enough information to use any storage type in C++, such as
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 'mapping': [('k' + camel_case(k), enum_for_css_keyword(k)) f or k in property_['keywords']], 368 'mapping': [('k' + camel_case(k), enum_for_css_keyword(k)) f or k in property_['keywords']],
367 } 369 }
368 370
369 return { 371 return {
370 'include_paths': self._include_paths, 372 'include_paths': self._include_paths,
371 'mappings': mappings, 373 'mappings': mappings,
372 } 374 }
373 375
374 if __name__ == '__main__': 376 if __name__ == '__main__':
375 json5_generator.Maker(ComputedStyleBaseWriter).main() 377 json5_generator.Maker(ComputedStyleBaseWriter).main()
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698