RESOLVED FIXED 162885
Add tests verifying non-special URL hosts are parsed according to spec
https://bugs.webkit.org/show_bug.cgi?id=162885
Summary Add tests verifying non-special URL hosts are parsed according to spec
Alex Christensen
Reported 2016-10-03 18:43:19 PDT
Add tests verifying non-special URL hosts are parsed according to spec
Attachments
Patch (1.92 KB, patch)
2016-10-03 18:43 PDT, Alex Christensen
sam: review+
Alex Christensen
Comment 1 2016-10-03 18:43:31 PDT
Alex Christensen
Comment 2 2016-10-03 18:48:08 PDT
The host parsing in https://url.spec.whatwg.org is a deviation from the behavior of Chrome, Firefox, and Safari, and there are no web platform tests verifying that non-special URLs are parsed the same as special URLs. Try this in different browsers: alert(new URL("notspecial://H%4fSt/path").toString()) It alerts "notspecial://H%4fSt/path" not "notspecial://host/path" as the spec says it should. Maybe I missed something in the spec, maybe the spec should be changed, or maybe it was intentional.
Anne van Kesteren
Comment 3 2016-10-04 01:36:36 PDT
Thanks, I filed https://github.com/whatwg/url/issues/148. I tend to think we should just change the standard.
Alex Christensen
Comment 4 2016-10-04 09:44:16 PDT
I agree. It will increase compatibility. But this means the fragment is no longer the only part of the URL that can have non-ASCII characters :(
Alex Christensen
Comment 5 2016-10-04 10:16:07 PDT
(In reply to comment #4) > But this means the fragment is no longer the only part of the URL that can have non-ASCII characters :( Oh, never mind. non-ASCII characters are percent encoded.
Alex Christensen
Comment 6 2016-10-04 16:17:05 PDT
Nope, we don't want to percent encode things in the host. I think the spec is right and all browsers are wrong for different reasons. Everyone needs to change, ours is to punycode encode non-special hosts. http://trac.webkit.org/changeset/206792
Note You need to log in before you can comment on or make changes to this bug.