Add tests verifying non-special URL hosts are parsed according to spec
Created attachment 290547 [details] Patch
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.
Thanks, I filed https://github.com/whatwg/url/issues/148. I tend to think we should just change the standard.
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 :(
(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.
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