| OLD | NEW |
| 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 'isLink', |
| 19 # Style can not be shared. | 20 # Style can not be shared. |
| 20 'unique', | 21 'unique', |
| 21 # Whether this style is affected by these pseudo-classes. | 22 # Whether this style is affected by these pseudo-classes. |
| 22 'affectedByFocus', | 23 'affectedByFocus', |
| 23 'affectedByHover', | 24 'affectedByHover', |
| 24 'affectedByActive', | 25 'affectedByActive', |
| 25 'affectedByDrag', | 26 'affectedByDrag', |
| 26 # A non-inherited property references a variable or @apply is used | 27 # A non-inherited property references a variable or @apply is used |
| 27 'hasVariableReferenceFromNonInheritedProperty', | 28 'hasVariableReferenceFromNonInheritedProperty', |
| 28 # Explicitly inherits a non-inherited property | 29 # Explicitly inherits a non-inherited property |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 'mapping': [('k' + camel_case(k), enum_for_css_keyword(k)) f
or k in property_['keywords']], | 371 'mapping': [('k' + camel_case(k), enum_for_css_keyword(k)) f
or k in property_['keywords']], |
| 371 } | 372 } |
| 372 | 373 |
| 373 return { | 374 return { |
| 374 'include_paths': self._include_paths, | 375 'include_paths': self._include_paths, |
| 375 'mappings': mappings, | 376 'mappings': mappings, |
| 376 } | 377 } |
| 377 | 378 |
| 378 if __name__ == '__main__': | 379 if __name__ == '__main__': |
| 379 json5_generator.Maker(ComputedStyleBaseWriter).main() | 380 json5_generator.Maker(ComputedStyleBaseWriter).main() |
| OLD | NEW |