[Webkit-unassigned] [Bug 135929] import-w3c-tests doesn't handle relative paths to support files in ref files correctly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 10 08:29:02 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=135929


Bem Jones-Bey <bjonesbe at adobe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #237877|review?                     |review+
               Flag|                            |




--- Comment #8 from Bem Jones-Bey <bjonesbe at adobe.com>  2014-09-10 08:29:06 PST ---
(From update of attachment 237877)
View in context: https://bugs.webkit.org/attachment.cgi?id=237877&action=review

r=me, but please make the following updates before landing

> Tools/Scripts/webkitpy/w3c/test_converter.py:149
> +        else:

WebKit style is to omit this else.

> Tools/Scripts/webkitpy/w3c/test_converter.py:172
> +                if attr_name == 'src' and attr_value in self.reference_support_info['files']:
> +                    converted = self.convert_reference_relpaths(attr_value)

You're walking through reference_support_info['files'] twice in this situation. Either remove the check here ("and attr_value in self.reference_support_info['files']"), or create a more specific helper function to do the replacement, and call that both from here and from convert_reference_relpaths.

> Tools/Scripts/webkitpy/w3c/test_parser.py:141
> +            if not(path.startswith('http:')) and not(path.startswith('mailto:')) and not(path.startswith('data:')):

This is fragile, I think it would be better to do:

uri_scheme_pattern = re.compile(r"[A-Za-z][A-Za-z+.-]*:");
if uri_scheme_pattern.match(path):

I got the pattern from: http://tools.ietf.org/html/rfc3986#section-3.1
It will also match paths that start with a windows drive letter, but I'm pretty sure that such platform specific paths won't end up in the W3C repos. :-)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list