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': 'flag', 'default_value': 'fal se', | |
nainar
2017/04/05 16:41:49
why isnt it a monotonic flag for my own understand
shend
2017/04/05 22:32:36
Good question. setHasViewportUnits currently takes
alancutter (OOO until 2018)
2017/04/06 04:18:49
I don't think this "hack" is the reason it's not a
| |
56 '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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
387 'mapping': [(enum_value_name(k), enum_for_css_keyword(k)) fo r k in property_['keywords']], | 393 'mapping': [(enum_value_name(k), enum_for_css_keyword(k)) fo r k in property_['keywords']], |
388 } | 394 } |
389 | 395 |
390 return { | 396 return { |
391 'include_paths': self._include_paths, | 397 'include_paths': self._include_paths, |
392 'mappings': mappings, | 398 'mappings': mappings, |
393 } | 399 } |
394 | 400 |
395 if __name__ == '__main__': | 401 if __name__ == '__main__': |
396 json5_generator.Maker(ComputedStyleBaseWriter).main() | 402 json5_generator.Maker(ComputedStyleBaseWriter).main() |
OLD | NEW |