| 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 ( | 13 from name_utilities import ( |
| 14 enum_for_css_keyword, enum_type_name, enum_value_name, class_member_name, me
thod_name | 14 enum_for_css_keyword, enum_type_name, enum_value_name, class_member_name, me
thod_name |
| 15 ) | 15 ) |
| 16 | 16 |
| 17 | 17 |
| 18 # Temporary hard-coded list of fields that are not CSS properties. | 18 # Temporary hard-coded list of fields that are not CSS properties. |
| 19 # TODO(shend): Put this into its own JSON5 file. | 19 # TODO(shend): Put this into its own JSON5 file. |
| 20 NONPROPERTIES = [ | 20 NONPROPERTIES = [ |
| 21 {'name': 'IsLink', 'field_template': 'monotonic_flag', | 21 {'name': 'IsLink', 'field_template': 'monotonic_flag', |
| 22 'inherited': False, 'independent': False}, | 22 'inherited': False, 'independent': False}, |
| 23 {'name': 'OriginalDisplay', 'field_template': 'keyword', 'initial_keyword':
'inline', |
| 24 'type_name': 'EDisplay', 'inherited': False, 'independent': False, |
| 25 'keywords': [ |
| 26 "inline", "block", "list-item", "inline-block", "table", "inline-table"
, "table-row-group", "table-header-group", |
| 27 "table-footer-group", "table-row", "table-column-group", "table-column"
, "table-cell", "table-caption", "-webkit-box", |
| 28 "-webkit-inline-box", "flex", "inline-flex", "grid", "inline-grid", "co
ntents", "flow-root", "none" |
| 29 ]}, |
| 23 {'name': 'InsideLink', 'field_template': 'keyword', 'initial_keyword': 'not-
inside-link', | 30 {'name': 'InsideLink', 'field_template': 'keyword', 'initial_keyword': 'not-
inside-link', |
| 24 'keywords': ['not-inside-link', 'inside-unvisited-link', 'inside-visited-li
nk'], | 31 'keywords': ['not-inside-link', 'inside-unvisited-link', 'inside-visited-li
nk'], |
| 25 'inherited': True, 'independent': False}, | 32 'inherited': True, 'independent': False}, |
| 26 # Style can not be shared. | 33 # Style can not be shared. |
| 27 {'name': 'Unique', 'field_template': 'monotonic_flag', | 34 {'name': 'Unique', 'field_template': 'monotonic_flag', |
| 28 'inherited': False, 'independent': False}, | 35 'inherited': False, 'independent': False}, |
| 29 # Whether this style is affected by these pseudo-classes. | 36 # Whether this style is affected by these pseudo-classes. |
| 30 {'name': 'AffectedByFocus', 'field_template': 'monotonic_flag', | 37 {'name': 'AffectedByFocus', 'field_template': 'monotonic_flag', |
| 31 'inherited': False, 'independent': False}, | 38 'inherited': False, 'independent': False}, |
| 32 {'name': 'AffectedByHover', 'field_template': 'monotonic_flag', | 39 {'name': 'AffectedByHover', 'field_template': 'monotonic_flag', |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 'mapping': [(enum_value_name(k), enum_for_css_keyword(k)) fo
r k in property_['keywords']], | 367 'mapping': [(enum_value_name(k), enum_for_css_keyword(k)) fo
r k in property_['keywords']], |
| 361 } | 368 } |
| 362 | 369 |
| 363 return { | 370 return { |
| 364 'include_paths': self._include_paths, | 371 'include_paths': self._include_paths, |
| 365 'mappings': mappings, | 372 'mappings': mappings, |
| 366 } | 373 } |
| 367 | 374 |
| 368 if __name__ == '__main__': | 375 if __name__ == '__main__': |
| 369 json5_generator.Maker(ComputedStyleBaseWriter).main() | 376 json5_generator.Maker(ComputedStyleBaseWriter).main() |
| OLD | NEW |