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

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_converter.py

Issue 2620883002: Convert Settings.in, CSSValueKeywords.in, SVGCSSValueKeywords.in to json5 (Closed)
Patch Set: Convert CSSProperties.in to json5 format Created 3 years, 11 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 # 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 self.converted_properties = [] 80 self.converted_properties = []
81 self.in_style_tag = False 81 self.in_style_tag = False
82 self.style_data = [] 82 self.style_data = []
83 self.filename = filename 83 self.filename = filename
84 self.reference_support_info = reference_support_info 84 self.reference_support_info = reference_support_info
85 resources_path = self.path_from_webkit_root('LayoutTests', 'resources') 85 resources_path = self.path_from_webkit_root('LayoutTests', 'resources')
86 resources_relpath = self._filesystem.relpath(resources_path, new_path) 86 resources_relpath = self._filesystem.relpath(resources_path, new_path)
87 self.resources_relpath = resources_relpath 87 self.resources_relpath = resources_relpath
88 88
89 # These settings might vary between WebKit and Blink. 89 # These settings might vary between WebKit and Blink.
90 self._css_property_file = self.path_from_webkit_root('Source', 'core', ' css', 'CSSProperties.in') 90 self._css_property_file = self.path_from_webkit_root('Source', 'core', ' css', 'CSSProperties.json5')
91 self.prefixed_properties = self.read_webkit_prefixed_css_property_list() 91 self.prefixed_properties = self.read_webkit_prefixed_css_property_list()
92 prop_regex = r'([\s{]|^)(' + '|'.join( 92 prop_regex = r'([\s{]|^)(' + '|'.join(
93 prop.replace('-webkit-', '') for prop in self.prefixed_properties) + r')(\s+:|:)' 93 prop.replace('-webkit-', '') for prop in self.prefixed_properties) + r')(\s+:|:)'
94 self.prop_re = re.compile(prop_regex) 94 self.prop_re = re.compile(prop_regex)
95 95
96 def output(self): 96 def output(self):
97 return (self.converted_properties, ''.join(self.converted_data)) 97 return (self.converted_properties, ''.join(self.converted_data))
98 98
99 def path_from_webkit_root(self, *comps): 99 def path_from_webkit_root(self, *comps):
100 return self._filesystem.abspath(self._filesystem.join(self._webkit_root, *comps)) 100 return self._filesystem.abspath(self._filesystem.join(self._webkit_root, *comps))
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 self.converted_data.extend(['&#', name, ';']) 225 self.converted_data.extend(['&#', name, ';'])
226 226
227 def handle_comment(self, data): 227 def handle_comment(self, data):
228 self.converted_data.extend(['<!--', data, '-->']) 228 self.converted_data.extend(['<!--', data, '-->'])
229 229
230 def handle_decl(self, decl): 230 def handle_decl(self, decl):
231 self.converted_data.extend(['<!', decl, '>']) 231 self.converted_data.extend(['<!', decl, '>'])
232 232
233 def handle_pi(self, data): 233 def handle_pi(self, data):
234 self.converted_data.extend(['<?', data, '>']) 234 self.converted_data.extend(['<?', data, '>'])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698