Percent-encode non-ASCII code points in hosts of URLs with unrecognized schemes
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Nov 2016 21:31:40 +0000 (21:31 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Nov 2016 21:31:40 +0000 (21:31 +0000)
commitd9026235dfefa7758be3ff69072de956afc77e65
treee230829bf085a033fe43a67601a8e09a0e1957e5
parentaab2dcc447f553858b120e535fa954b23d0252e8
Percent-encode non-ASCII code points in hosts of URLs with unrecognized schemes
https://bugs.webkit.org/show_bug.cgi?id=164290

Reviewed by Tim Horton.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

NSURL fails to parse these URLs, WebKit used to punycode encode them, but now we match Chrome and Firefox,
as well as what will likely become the standard once https://github.com/whatwg/url/issues/148 is resolved.
We continue to parse IPv6 address hosts because otherwise we wouldn't be able to tell where a port
starts in a URL with colons in the IPv6 address and before the port like "a://[b::c]:4"

Covered by new API tests and updated LayoutTests.

* platform/URLParser.cpp:
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::parseHostAndPort):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::checkRelativeURL):
(TestWebKitAPI::checkURLDifferences):
(TestWebKitAPI::checkRelativeURLDifferences):
Move helper functions to the top so I can use them from any tests.
(TestWebKitAPI::shouldFail):
(TestWebKitAPI::checkURL):
(TestWebKitAPI::TEST_F):

LayoutTests:

* fast/url/host-lowercase-per-scheme-expected.txt:
* fast/url/safari-extension-expected.txt:
* fetch/fetch-url-serialization-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/url/host-lowercase-per-scheme-expected.txt
LayoutTests/fast/url/safari-extension-expected.txt
LayoutTests/fetch/fetch-url-serialization-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt
LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt
LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/URLParser.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp