| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 3 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions | 6 # modification, are permitted provided that the following conditions |
| 7 # are met: | 7 # are met: |
| 8 # | 8 # |
| 9 # 1. Redistributions of source code must retain the above | 9 # 1. Redistributions of source code must retain the above |
| 10 # copyright notice, this list of conditions and the following | 10 # copyright notice, this list of conditions and the following |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 'text-combine-upright': '-webkit-text-combine' | 88 'text-combine-upright': '-webkit-text-combine' |
| 89 } | 89 } |
| 90 self.renamed_values = { | 90 self.renamed_values = { |
| 91 'text-combine-upright': {'all': 'horizontal'} | 91 'text-combine-upright': {'all': 'horizontal'} |
| 92 } | 92 } |
| 93 | 93 |
| 94 prop_regex = '([\s{]|^)(' + "|".join(itertools.chain( | 94 prop_regex = '([\s{]|^)(' + "|".join(itertools.chain( |
| 95 self.renamed_properties.iterkeys(), | 95 self.renamed_properties.iterkeys(), |
| 96 self.renamed_values.iterkeys(), | 96 self.renamed_values.iterkeys(), |
| 97 self.prefixed_values.iterkeys(), | 97 self.prefixed_values.iterkeys(), |
| 98 (prop.replace('-webkit-', '') for prop in self.prefixed_properties))
) + ')(\s+:|:[^;]*)' | 98 (prop.replace('-webkit-', '') for prop in self.prefixed_properties))
) + ')(\s*:\s*[-\w]*)' |
| 99 self.prop_re = re.compile(prop_regex) | 99 self.prop_re = re.compile(prop_regex) |
| 100 | 100 |
| 101 def output(self): | 101 def output(self): |
| 102 return (self.converted_properties, ''.join(self.converted_data)) | 102 return (self.converted_properties, ''.join(self.converted_data)) |
| 103 | 103 |
| 104 def path_from_webkit_root(self, *comps): | 104 def path_from_webkit_root(self, *comps): |
| 105 return self._filesystem.abspath(self._filesystem.join(self._webkit_root,
*comps)) | 105 return self._filesystem.abspath(self._filesystem.join(self._webkit_root,
*comps)) |
| 106 | 106 |
| 107 def read_webkit_prefixed_css_property_list(self): | 107 def read_webkit_prefixed_css_property_list(self): |
| 108 prefixed_properties = [] | 108 prefixed_properties = [] |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 self.converted_data.extend(['&#', name, ';']) | 254 self.converted_data.extend(['&#', name, ';']) |
| 255 | 255 |
| 256 def handle_comment(self, data): | 256 def handle_comment(self, data): |
| 257 self.converted_data.extend(['<!-- ', data, ' -->']) | 257 self.converted_data.extend(['<!-- ', data, ' -->']) |
| 258 | 258 |
| 259 def handle_decl(self, decl): | 259 def handle_decl(self, decl): |
| 260 self.converted_data.extend(['<!', decl, '>']) | 260 self.converted_data.extend(['<!', decl, '>']) |
| 261 | 261 |
| 262 def handle_pi(self, data): | 262 def handle_pi(self, data): |
| 263 self.converted_data.extend(['<?', data, '>']) | 263 self.converted_data.extend(['<?', data, '>']) |
| OLD | NEW |