| OLD | NEW |
| 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions | 4 # modification, are permitted provided that the following conditions |
| 5 # are met: | 5 # are met: |
| 6 # | 6 # |
| 7 # 1. Redistributions of source code must retain the above | 7 # 1. Redistributions of source code must retain the above |
| 8 # copyright notice, this list of conditions and the following | 8 # copyright notice, this list of conditions and the following |
| 9 # disclaimer. | 9 # disclaimer. |
| 10 # 2. Redistributions in binary form must reproduce the above | 10 # 2. Redistributions in binary form must reproduce the above |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 filename: Absolute path to where the file is. | 44 filename: Absolute path to where the file is. |
| 45 reference_support_info: Dict of information about a related reference HT
ML, if any. | 45 reference_support_info: Dict of information about a related reference HT
ML, if any. |
| 46 | 46 |
| 47 Returns: | 47 Returns: |
| 48 A pair of (list of modified CSS properties, modified text) if the file | 48 A pair of (list of modified CSS properties, modified text) if the file |
| 49 should be modified; None, if the file is not modified. | 49 should be modified; None, if the file is not modified. |
| 50 """ | 50 """ |
| 51 # Conversion is not necessary for any tests in wpt now; see http://crbug.com
/654081. | 51 # Conversion is not necessary for any tests in wpt now; see http://crbug.com
/654081. |
| 52 if re.search(r'[/\\]imported[/\\]wpt[/\\]', new_path): | 52 if re.search(r'[/\\]imported[/\\]wpt[/\\]', new_path): |
| 53 return None | 53 return None |
| 54 # Skip gzipped SVGs. |
| 55 if filename.endswith('.svgz'): |
| 56 return None |
| 54 | 57 |
| 55 contents = host.filesystem.read_binary_file(filename) | 58 contents = host.filesystem.read_binary_file(filename) |
| 56 converter = _W3CTestConverter(new_path, filename, reference_support_info, ho
st) | 59 converter = _W3CTestConverter(new_path, filename, reference_support_info, ho
st) |
| 57 if filename.endswith('.css'): | 60 if filename.endswith('.css'): |
| 58 return converter.add_webkit_prefix_to_unprefixed_properties(contents.dec
ode('utf-8')) | 61 return converter.add_webkit_prefix_to_unprefixed_properties(contents.dec
ode('utf-8')) |
| 59 else: | 62 else: |
| 60 try: | 63 try: |
| 61 converter.feed(contents.decode('utf-8')) | 64 converter.feed(contents.decode('utf-8')) |
| 62 except UnicodeDecodeError: | 65 except UnicodeDecodeError: |
| 63 converter.feed(contents.decode('utf-16')) | 66 converter.feed(contents.decode('utf-16')) |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 self.converted_data.extend(['&#', name, ';']) | 226 self.converted_data.extend(['&#', name, ';']) |
| 224 | 227 |
| 225 def handle_comment(self, data): | 228 def handle_comment(self, data): |
| 226 self.converted_data.extend(['<!--', data, '-->']) | 229 self.converted_data.extend(['<!--', data, '-->']) |
| 227 | 230 |
| 228 def handle_decl(self, decl): | 231 def handle_decl(self, decl): |
| 229 self.converted_data.extend(['<!', decl, '>']) | 232 self.converted_data.extend(['<!', decl, '>']) |
| 230 | 233 |
| 231 def handle_pi(self, data): | 234 def handle_pi(self, data): |
| 232 self.converted_data.extend(['<?', data, '>']) | 235 self.converted_data.extend(['<?', data, '>']) |
| OLD | NEW |