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

Unified Diff: third_party/WebKit/Source/build/scripts/make_computed_style_base.py

Issue 2812823004: Revert of Separate CSSValueID mappings generator from ComputedStyleBase generator. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/make_css_value_id_mappings.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/make_computed_style_base.py
diff --git a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
index f9aeb8949f4dea9b32b38946f253fb15da45a80e..93b49a89c21cb2eac7bccbd447655fecd5154742 100755
--- a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
+++ b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
@@ -286,6 +286,7 @@
'ComputedStyleBase.h': self.generate_base_computed_style_h,
'ComputedStyleBase.cpp': self.generate_base_computed_style_cpp,
'ComputedStyleBaseConstants.h': self.generate_base_computed_style_constants,
+ 'CSSValueIDMappingsGenerated.h': self.generate_css_value_mappings,
}
# TODO(shend): Remove this once we move NONPROPERTIES to its own JSON file,
@@ -373,5 +374,21 @@
'fields': self._fields,
}
+ @template_expander.use_jinja('CSSValueIDMappingsGenerated.h.tmpl')
+ def generate_css_value_mappings(self):
+ mappings = {}
+
+ for property_ in self._properties.values():
+ if property_['field_template'] == 'keyword':
+ mappings[property_['type_name']] = {
+ 'default_value': enum_value_name(property_['default_value']),
+ 'mapping': [(enum_value_name(k), enum_for_css_keyword(k)) for k in property_['keywords']],
+ }
+
+ return {
+ 'include_paths': self._include_paths,
+ 'mappings': mappings,
+ }
+
if __name__ == '__main__':
json5_generator.Maker(ComputedStyleBaseWriter).main()
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/make_css_value_id_mappings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698