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

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

Issue 2657423004: Moved nonproperty isLink to be generated 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 26 # A non-inherited property references a variable or @apply is used
27 'hasVariableReferenceFromNonInheritedProperty', 27 'hasVariableReferenceFromNonInheritedProperty',
28 # Explicitly inherits a non-inherited property 28 # Explicitly inherits a non-inherited property
29 'hasExplicitlyInheritedProperties', 29 'hasExplicitlyInheritedProperties',
30 # Is this element a link?
meade_UTC10 2017/03/14 06:59:09 I wonder if comments like this are actually helpfu
shend 2017/03/14 07:21:40 lol true
31 'isLink',
30 ]) 32 ])
31 33
32 34
33 class Field(object): 35 class Field(object):
34 """ 36 """
35 The generated ComputedStyle object is made up of a series of Fields. 37 The generated ComputedStyle object is made up of a series of Fields.
36 Each Field has a name, size, type, etc, and a bunch of attributes to 38 Each Field has a name, size, type, etc, and a bunch of attributes to
37 determine which methods it will be used in. 39 determine which methods it will be used in.
38 40
39 A Field also has enough information to use any storage type in C++, such as 41 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
370 'mapping': [('k' + camel_case(k), enum_for_css_keyword(k)) f or k in property_['keywords']], 372 'mapping': [('k' + camel_case(k), enum_for_css_keyword(k)) f or k in property_['keywords']],
371 } 373 }
372 374
373 return { 375 return {
374 'include_paths': self._include_paths, 376 'include_paths': self._include_paths,
375 'mappings': mappings, 377 'mappings': mappings,
376 } 378 }
377 379
378 if __name__ == '__main__': 380 if __name__ == '__main__':
379 json5_generator.Maker(ComputedStyleBaseWriter).main() 381 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