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

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

Issue 2797963002: Generate ComputedStyle::hasViewportUnits and hasRemUnits. (Closed)
Patch Set: Rebase Created 3 years, 8 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
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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()
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