| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (C) 2013 Intel Corporation. All rights reserved. | 2 # Copyright (C) 2013 Intel Corporation. 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 | 37 |
| 38 class StylePropertyShorthandWriter(in_generator.Writer): | 38 class StylePropertyShorthandWriter(in_generator.Writer): |
| 39 class_name = 'StylePropertyShorthand' | 39 class_name = 'StylePropertyShorthand' |
| 40 | 40 |
| 41 defaults = { | 41 defaults = { |
| 42 'longhands': "", | 42 'longhands': "", |
| 43 'runtimeEnabledShorthand': None, | 43 'runtimeEnabledShorthand': None, |
| 44 } | 44 } |
| 45 | 45 |
| 46 def __init__(self, in_files, enabled_conditions): | 46 def __init__(self, in_files): |
| 47 super(StylePropertyShorthandWriter, self).__init__(in_files, enabled_con
ditions) | 47 super(StylePropertyShorthandWriter, self).__init__(in_files) |
| 48 self._outputs = {("StylePropertyShorthand.cpp"): self.generate_style_pro
perty_shorthand_cpp, ("StylePropertyShorthand.h"): self.generate_style_property_
shorthand_h} | 48 self._outputs = {("StylePropertyShorthand.cpp"): self.generate_style_pro
perty_shorthand_cpp, ("StylePropertyShorthand.h"): self.generate_style_property_
shorthand_h} |
| 49 | 49 |
| 50 self._properties = self.in_file.name_dictionaries | 50 self._properties = self.in_file.name_dictionaries |
| 51 self._longhand_dictionary = defaultdict(list) | 51 self._longhand_dictionary = defaultdict(list) |
| 52 | 52 |
| 53 for property in self._properties: | 53 for property in self._properties: |
| 54 cc = self._camelcase_property_name(property["name"]) | 54 cc = self._camelcase_property_name(property["name"]) |
| 55 property["property_id"] = self._create_css_property_name_enum_value(
cc) | 55 property["property_id"] = self._create_css_property_name_enum_value(
cc) |
| 56 cc = cc[0].lower() + cc[1:] | 56 cc = cc[0].lower() + cc[1:] |
| 57 property["camel_case_name"] = cc | 57 property["camel_case_name"] = cc |
| (...skipping 29 matching lines...) Expand all Loading... |
| 87 } | 87 } |
| 88 | 88 |
| 89 @template_expander.use_jinja("StylePropertyShorthand.h.tmpl") | 89 @template_expander.use_jinja("StylePropertyShorthand.h.tmpl") |
| 90 def generate_style_property_shorthand_h(self): | 90 def generate_style_property_shorthand_h(self): |
| 91 return { | 91 return { |
| 92 "properties": self._properties, | 92 "properties": self._properties, |
| 93 } | 93 } |
| 94 | 94 |
| 95 if __name__ == "__main__": | 95 if __name__ == "__main__": |
| 96 in_generator.Maker(StylePropertyShorthandWriter).main(sys.argv) | 96 in_generator.Maker(StylePropertyShorthandWriter).main(sys.argv) |
| OLD | NEW |