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

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

Issue 1386733003: Do not accept CSS-wide keywords for descriptors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 6 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (C) 2013 Google Inc. All rights reserved. 2 # Copyright (C) 2013 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 simple_type_name = str(property['type_name']).split('::')[-1] 58 simple_type_name = str(property['type_name']).split('::')[-1]
59 set_if_none(property, 'type_name', 'E' + name) 59 set_if_none(property, 'type_name', 'E' + name)
60 set_if_none(property, 'getter', lower_first(name) if simple_type_nam e != name else 'get' + name) 60 set_if_none(property, 'getter', lower_first(name) if simple_type_nam e != name else 'get' + name)
61 set_if_none(property, 'setter', 'set' + name) 61 set_if_none(property, 'setter', 'set' + name)
62 set_if_none(property, 'initial', 'initial' + name) 62 set_if_none(property, 'initial', 'initial' + name)
63 if property['custom_all']: 63 if property['custom_all']:
64 property['custom_initial'] = True 64 property['custom_initial'] = True
65 property['custom_inherit'] = True 65 property['custom_inherit'] = True
66 property['custom_value'] = True 66 property['custom_value'] = True
67 property['should_declare_functions'] = not property['use_handlers_fo r'] and not property['longhands'] \ 67 property['should_declare_functions'] = not property['use_handlers_fo r'] and not property['longhands'] \
68 and not property['direction_a ware'] and not property['builder_skip'] 68 and not property['direction_aware'] and not property['builder_sk ip'] \
69 and not property['descriptor_only']
69 70
70 @template_expander.use_jinja('StyleBuilderFunctions.h.tmpl', 71 @template_expander.use_jinja('StyleBuilderFunctions.h.tmpl',
71 filters=filters) 72 filters=filters)
72 def generate_style_builder_functions_h(self): 73 def generate_style_builder_functions_h(self):
73 return { 74 return {
74 'properties': self._properties, 75 'properties': self._properties,
75 } 76 }
76 77
77 @template_expander.use_jinja('StyleBuilderFunctions.cpp.tmpl', 78 @template_expander.use_jinja('StyleBuilderFunctions.cpp.tmpl',
78 filters=filters) 79 filters=filters)
79 def generate_style_builder_functions_cpp(self): 80 def generate_style_builder_functions_cpp(self):
80 return { 81 return {
81 'properties': self._properties, 82 'properties': self._properties,
82 } 83 }
83 84
84 @template_expander.use_jinja('StyleBuilder.cpp.tmpl', filters=filters) 85 @template_expander.use_jinja('StyleBuilder.cpp.tmpl', filters=filters)
85 def generate_style_builder(self): 86 def generate_style_builder(self):
86 return { 87 return {
87 'properties': self._properties, 88 'properties': self._properties,
88 } 89 }
89 90
90 91
91 if __name__ == '__main__': 92 if __name__ == '__main__':
92 in_generator.Maker(StyleBuilderWriter).main(sys.argv) 93 in_generator.Maker(StyleBuilderWriter).main(sys.argv)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698