| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 {'name': 'AffectedByActive', 'field_template': 'monotonic_flag', | 43 {'name': 'AffectedByActive', 'field_template': 'monotonic_flag', |
| 44 'inherited': False, 'independent': False, 'default_value': False}, | 44 'inherited': False, 'independent': False, 'default_value': False}, |
| 45 {'name': 'AffectedByDrag', 'field_template': 'monotonic_flag', | 45 {'name': 'AffectedByDrag', 'field_template': 'monotonic_flag', |
| 46 'inherited': False, 'independent': False, 'default_value': False}, | 46 'inherited': False, 'independent': False, 'default_value': False}, |
| 47 # A non-inherited property references a variable or @apply is used | 47 # A non-inherited property references a variable or @apply is used |
| 48 {'name': 'HasVariableReferenceFromNonInheritedProperty', 'field_template': '
monotonic_flag', | 48 {'name': 'HasVariableReferenceFromNonInheritedProperty', 'field_template': '
monotonic_flag', |
| 49 'inherited': False, 'independent': False, 'default_value': False}, | 49 'inherited': False, 'independent': False, 'default_value': False}, |
| 50 # Explicitly inherits a non-inherited property | 50 # Explicitly inherits a non-inherited property |
| 51 {'name': 'HasExplicitlyInheritedProperties', 'field_template': 'monotonic_fl
ag', | 51 {'name': 'HasExplicitlyInheritedProperties', 'field_template': 'monotonic_fl
ag', |
| 52 'inherited': False, 'independent': False, 'default_value': False}, | 52 'inherited': False, 'independent': False, 'default_value': False}, |
| 53 # These are set if we used viewport or rem units when resolving a length. |
| 54 # TODO(shend): HasViewportUnits should be a monotonic_flag. |
| 55 {'name': 'HasViewportUnits', 'field_template': 'primitive', 'default_value':
'false', |
| 56 'type_name': 'bool', 'inherited': False, 'independent': False}, |
| 57 {'name': 'HasRemUnits', 'field_template': 'monotonic_flag', 'default_value':
'false', |
| 58 'inherited': False, 'independent': False}, |
| 53 # These properties only have generated storage, and their methods are handwr
itten in ComputedStyle. | 59 # These properties only have generated storage, and their methods are handwr
itten in ComputedStyle. |
| 54 # TODO(shend): Remove these fields and delete the 'storage_only' template. | 60 # TODO(shend): Remove these fields and delete the 'storage_only' template. |
| 55 {'name': 'EmptyState', 'field_template': 'storage_only', 'size': 1, 'default
_value': 'false', | 61 {'name': 'EmptyState', 'field_template': 'storage_only', 'size': 1, 'default
_value': 'false', |
| 56 'type_name': 'bool', 'inherited': False, 'independent': False}, | 62 'type_name': 'bool', 'inherited': False, 'independent': False}, |
| 57 {'name': 'StyleType', 'field_template': 'storage_only', 'size': 6, 'default_
value': '0', | 63 {'name': 'StyleType', 'field_template': 'storage_only', 'size': 6, 'default_
value': '0', |
| 58 'type_name': 'PseudoId', 'inherited': False, 'independent': False}, | 64 'type_name': 'PseudoId', 'inherited': False, 'independent': False}, |
| 59 {'name': 'PseudoBits', 'field_template': 'storage_only', 'size': 8, 'default
_value': 'PseudoIdNone', | 65 {'name': 'PseudoBits', 'field_template': 'storage_only', 'size': 8, 'default
_value': 'PseudoIdNone', |
| 60 'type_name': 'PseudoId', 'inherited': False, 'independent': False}, | 66 'type_name': 'PseudoId', 'inherited': False, 'independent': False}, |
| 61 # True if 'underline solid' is the only text decoration on this element. | 67 # True if 'underline solid' is the only text decoration on this element. |
| 62 {'name': 'HasSimpleUnderline', 'field_template': 'storage_only', 'size': 1,
'default_value': 'false', | 68 {'name': 'HasSimpleUnderline', 'field_template': 'storage_only', 'size': 1,
'default_value': 'false', |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 'mapping': [(enum_value_name(k), enum_for_css_keyword(k)) fo
r k in property_['keywords']], | 397 'mapping': [(enum_value_name(k), enum_for_css_keyword(k)) fo
r k in property_['keywords']], |
| 392 } | 398 } |
| 393 | 399 |
| 394 return { | 400 return { |
| 395 'include_paths': self._include_paths, | 401 'include_paths': self._include_paths, |
| 396 'mappings': mappings, | 402 'mappings': mappings, |
| 397 } | 403 } |
| 398 | 404 |
| 399 if __name__ == '__main__': | 405 if __name__ == '__main__': |
| 400 json5_generator.Maker(ComputedStyleBaseWriter).main() | 406 json5_generator.Maker(ComputedStyleBaseWriter).main() |
| OLD | NEW |