Skip to content

Commit

Permalink
Remove "gopher" from list of special schemes in URLParser
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=201852

Patch by Alex Christensen <achristensen@webkit.org> on 2019-09-16
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

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

Source/WTF:

There is little meaningful content on gopher servers, and WebKit does not actually support gopher.
This makes WebKit match the behavior of Gecko and goes along with a change proposed at
whatwg/url#342

* wtf/URLParser.cpp:
(WTF::URLParser::defaultPortForProtocol):
(WTF::scheme):
(WTF::URLParser::copyURLPartsUntil):
(WTF::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WTF/URLParser.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:

LayoutTests:

* fast/url/invalid-urls-utf8-expected.txt:
* fast/url/invalid-urls-utf8.html:
* fast/url/segments-expected.txt:
* fast/url/segments.html:
* fast/url/standard-url-expected.txt:
* fast/url/standard-url.html:
* fetch/fetch-urls.json:
* http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate-expected.txt:

Canonical link: https://commits.webkit.org/215492@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Alex Christensen authored and webkit-commit-queue committed Sep 17, 2019
1 parent 93c35b1 commit cde3bee
Show file tree
Hide file tree
Showing 23 changed files with 139 additions and 93 deletions.
16 changes: 16 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,19 @@
2019-09-16 Alex Christensen <achristensen@webkit.org>

Remove "gopher" from list of special schemes in URLParser
https://bugs.webkit.org/show_bug.cgi?id=201852

Reviewed by Simon Fraser.

* fast/url/invalid-urls-utf8-expected.txt:
* fast/url/invalid-urls-utf8.html:
* fast/url/segments-expected.txt:
* fast/url/segments.html:
* fast/url/standard-url-expected.txt:
* fast/url/standard-url.html:
* fetch/fetch-urls.json:
* http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate-expected.txt:

2019-09-16 Chris Dumez <cdumez@apple.com>

Unreviewed, rebaseline test after testharness.js update in r249918.
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/fast/url/invalid-urls-utf8-expected.txt
Expand Up @@ -24,7 +24,7 @@ FAIL src should be ws:/tête. Was ws://xn--tte-fma/.
FAIL src should be ftp:/tête. Was ftp://xn--tte-fma/.
FAIL src should be http:/tête. Was http://xn--tte-fma/.
FAIL src should be https:/tête. Was https://xn--tte-fma/.
FAIL src should be gopher:/tête. Was gopher://xn--tte-fma/.
PASS src is expected
PASS successfullyParsed is true

TEST COMPLETE
Expand Down
2 changes: 1 addition & 1 deletion LayoutTests/fast/url/invalid-urls-utf8.html
Expand Up @@ -41,7 +41,7 @@
'ftp:/tête',
'http:/tête',
'https:/tête',
'gopher:/tête',
'gopher:/t%C3%AAte',
];

for (var i = 0; i < testSet.length; ++i) {
Expand Down
4 changes: 2 additions & 2 deletions LayoutTests/fast/url/segments-expected.txt
Expand Up @@ -75,7 +75,7 @@ PASS segments('https:/example.com/') is '["https:","example.com","","/","",""]'
PASS segments('madeupscheme:/example.com/') is '["madeupscheme:","","","/example.com/","",""]'
PASS segments('file:/example.com/') is '["file:","","","/example.com/","",""]'
PASS segments('ftps:/example.com/') is '["ftps:","","","/example.com/","",""]'
PASS segments('gopher:/example.com/') is '["gopher:","example.com","","/","",""]'
PASS segments('gopher:/example.com/') is '["gopher:","","","/example.com/","",""]'
PASS segments('ws:/example.com/') is '["ws:","example.com","","/","",""]'
PASS segments('wss:/example.com/') is '["wss:","example.com","","/","",""]'
PASS segments('data:/example.com/') is '["data:","","","/example.com/","",""]'
Expand All @@ -87,7 +87,7 @@ PASS segments('https:example.com/') is '["https:","example.com","","/","",""]'
PASS segments('madeupscheme:example.com/') is '["madeupscheme:","","","example.com/","",""]'
PASS segments('file:example.com/') is '["file:","","","/example.com/","",""]'
PASS segments('ftps:example.com/') is '["ftps:","","","example.com/","",""]'
PASS segments('gopher:example.com/') is '["gopher:","example.com","","/","",""]'
PASS segments('gopher:example.com/') is '["gopher:","","","example.com/","",""]'
PASS segments('ws:example.com/') is '["ws:","example.com","","/","",""]'
PASS segments('wss:example.com/') is '["wss:","example.com","","/","",""]'
PASS segments('data:example.com/') is '["data:","","","example.com/","",""]'
Expand Down
4 changes: 2 additions & 2 deletions LayoutTests/fast/url/segments.html
Expand Up @@ -83,7 +83,7 @@
["madeupscheme:/example.com/", ["madeupscheme:","","","/example.com/","",""]],
["file:/example.com/", ["file:","","","/example.com/","",""]],
["ftps:/example.com/", ["ftps:","","","/example.com/","",""]],
["gopher:/example.com/", ["gopher:","example.com","","/","",""]],
["gopher:/example.com/", ["gopher:","","","/example.com/","",""]],
["ws:/example.com/", ["ws:","example.com","","/","",""]],
["wss:/example.com/", ["wss:","example.com","","/","",""]],
["data:/example.com/", ["data:","","","/example.com/","",""]],
Expand All @@ -95,7 +95,7 @@
["madeupscheme:example.com/", ["madeupscheme:","","","example.com/","",""]],
["file:example.com/", ["file:","","","/example.com/","",""]],
["ftps:example.com/", ["ftps:","","","example.com/","",""]],
["gopher:example.com/", ["gopher:","example.com","","/","",""]],
["gopher:example.com/", ["gopher:","","","example.com/","",""]],
["ws:example.com/", ["ws:","example.com","","/","",""]],
["wss:example.com/", ["wss:","example.com","","/","",""]],
["data:example.com/", ["data:","","","example.com/","",""]],
Expand Down
6 changes: 3 additions & 3 deletions LayoutTests/fast/url/standard-url-expected.txt
Expand Up @@ -22,7 +22,7 @@ PASS canonicalize('https://foo:443/') is 'https://foo/'
PASS canonicalize('https://foo:80/') is 'https://foo:80/'
PASS canonicalize('ftp://foo:21/') is 'ftp://foo/'
PASS canonicalize('ftp://foo:80/') is 'ftp://foo:80/'
PASS canonicalize('gopher://foo:70/') is 'gopher://foo/'
PASS canonicalize('gopher://foo:70/') is 'gopher://foo:70/'
PASS canonicalize('gopher://foo:443/') is 'gopher://foo:443/'
PASS canonicalize('ws://foo:80/') is 'ws://foo/'
PASS canonicalize('ws://foo:81/') is 'ws://foo:81/'
Expand All @@ -38,7 +38,7 @@ PASS canonicalize('https:/example.com/') is 'https://example.com/'
PASS canonicalize('madeupscheme:/example.com/') is 'madeupscheme:/example.com/'
FAIL canonicalize('file:/example.com/') should be file://localhost/example.com/. Was file:///example.com/.
PASS canonicalize('ftps:/example.com/') is 'ftps:/example.com/'
PASS canonicalize('gopher:/example.com/') is 'gopher://example.com/'
PASS canonicalize('gopher:/example.com/') is 'gopher:/example.com/'
PASS canonicalize('ws:/example.com/') is 'ws://example.com/'
PASS canonicalize('wss:/example.com/') is 'wss://example.com/'
PASS canonicalize('data:/example.com/') is 'data:/example.com/'
Expand All @@ -49,7 +49,7 @@ PASS canonicalize('ftp:example.com/') is 'ftp://example.com/'
PASS canonicalize('https:example.com/') is 'https://example.com/'
PASS canonicalize('madeupscheme:example.com/') is 'madeupscheme:example.com/'
PASS canonicalize('ftps:example.com/') is 'ftps:example.com/'
PASS canonicalize('gopher:example.com/') is 'gopher://example.com/'
PASS canonicalize('gopher:example.com/') is 'gopher:example.com/'
PASS canonicalize('ws:example.com/') is 'ws://example.com/'
PASS canonicalize('wss:example.com/') is 'wss://example.com/'
PASS canonicalize('data:example.com/') is 'data:example.com/'
Expand Down
6 changes: 3 additions & 3 deletions LayoutTests/fast/url/standard-url.html
Expand Up @@ -36,7 +36,7 @@
["https://foo:80/", "https://foo:80/"],
["ftp://foo:21/", "ftp://foo/"],
["ftp://foo:80/", "ftp://foo:80/"],
["gopher://foo:70/", "gopher://foo/"],
["gopher://foo:70/", "gopher://foo:70/"],
["gopher://foo:443/", "gopher://foo:443/"],
["ws://foo:80/", "ws://foo/"],
["ws://foo:81/", "ws://foo:81/"],
Expand All @@ -52,7 +52,7 @@
["madeupscheme:/example.com/", "madeupscheme:/example.com/"],
["file:/example.com/", "file://localhost/example.com/"],
["ftps:/example.com/", "ftps:/example.com/"],
["gopher:/example.com/", "gopher://example.com/"],
["gopher:/example.com/", "gopher:/example.com/"],
["ws:/example.com/", "ws://example.com/"],
["wss:/example.com/", "wss://example.com/"],
["data:/example.com/", "data:/example.com/"],
Expand All @@ -63,7 +63,7 @@
["https:example.com/", "https://example.com/"],
["madeupscheme:example.com/", "madeupscheme:example.com/"],
["ftps:example.com/", "ftps:example.com/"],
["gopher:example.com/", "gopher://example.com/"],
["gopher:example.com/", "gopher:example.com/"],
["ws:example.com/", "ws://example.com/"],
["wss:example.com/", "wss://example.com/"],
["data:example.com/", "data:example.com/"],
Expand Down
12 changes: 6 additions & 6 deletions LayoutTests/fetch/fetch-urls.json
Expand Up @@ -949,7 +949,7 @@ executeTests(
{
"input": "gopher:/example.com/",
"base": "http://example.org/foo/bar",
"href": "gopher://example.com/",
"href": "gopher:/example.com/",
"origin": "gopher://example.com",
"protocol": "gopher:",
"username": "",
Expand Down Expand Up @@ -1114,7 +1114,7 @@ executeTests(
{
"input": "gopher:example.com/",
"base": "http://example.org/foo/bar",
"href": "gopher://example.com/",
"href": "gopher:example.com/",
"origin": "gopher://example.com",
"protocol": "gopher:",
"username": "",
Expand Down Expand Up @@ -2358,14 +2358,14 @@ executeTests(
{
"input": "gopher://foo:70/",
"base": "about:blank",
"href": "gopher://foo/",
"href": "gopher://foo:70/",
"origin": "gopher://foo",
"protocol": "gopher:",
"username": "",
"password": "",
"host": "foo",
"hostname": "foo",
"port": "",
"port": "70",
"pathname": "/",
"search": "",
"hash": ""
Expand Down Expand Up @@ -2597,7 +2597,7 @@ executeTests(
{
"input": "gopher:/example.com/",
"base": "about:blank",
"href": "gopher://example.com/",
"href": "gopher:/example.com/",
"origin": "gopher://example.com",
"protocol": "gopher:",
"username": "",
Expand Down Expand Up @@ -2762,7 +2762,7 @@ executeTests(
{
"input": "gopher:example.com/",
"base": "about:blank",
"href": "gopher://example.com/",
"href": "gopher:example.com/",
"origin": "gopher://example.com",
"protocol": "gopher:",
"username": "",
Expand Down
Expand Up @@ -2,7 +2,7 @@
PASS Set HTTP URL frame location.protocol to x
PASS Set data URL frame location.protocol to x
PASS Set HTTP URL frame location.protocol to data
PASS Set data URL frame location.protocol to data
FAIL Set data URL frame location.protocol to data The object can not be cloned.
PASS Set HTTP URL frame location.protocol to file
PASS Set data URL frame location.protocol to file
PASS Set HTTP URL frame location.protocol to ftp
Expand Down
15 changes: 15 additions & 0 deletions LayoutTests/imported/w3c/ChangeLog
@@ -1,3 +1,18 @@
2019-09-16 Alex Christensen <achristensen@webkit.org>

Remove "gopher" from list of special schemes in URLParser
https://bugs.webkit.org/show_bug.cgi?id=201852

Reviewed by Simon Fraser.

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

2019-09-16 Chris Dumez <cdumez@apple.com>

Update testharness.js from upstream
Expand Down
Expand Up @@ -84,7 +84,7 @@ PASS Parsing: <file://example:test/> against <about:blank>
PASS Parsing: <file://example%/> against <about:blank>
PASS Parsing: <file://[example]/> against <about:blank>
PASS Parsing: <ftps:/example.com/> against <http://example.org/foo/bar>
PASS Parsing: <gopher:/example.com/> against <http://example.org/foo/bar>
FAIL Parsing: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: href expected "gopher://example.com/" but got "gopher:/example.com/"
PASS Parsing: <ws:/example.com/> against <http://example.org/foo/bar>
PASS Parsing: <wss:/example.com/> against <http://example.org/foo/bar>
PASS Parsing: <data:/example.com/> against <http://example.org/foo/bar>
Expand All @@ -95,7 +95,7 @@ PASS Parsing: <ftp:example.com/> against <http://example.org/foo/bar>
PASS Parsing: <https:example.com/> against <http://example.org/foo/bar>
PASS Parsing: <madeupscheme:example.com/> against <http://example.org/foo/bar>
PASS Parsing: <ftps:example.com/> against <http://example.org/foo/bar>
PASS Parsing: <gopher:example.com/> against <http://example.org/foo/bar>
FAIL Parsing: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: href expected "gopher://example.com/" but got "gopher:example.com/"
PASS Parsing: <ws:example.com/> against <http://example.org/foo/bar>
PASS Parsing: <wss:example.com/> against <http://example.org/foo/bar>
PASS Parsing: <data:example.com/> against <http://example.org/foo/bar>
Expand Down Expand Up @@ -181,7 +181,7 @@ PASS Parsing: <https://foo:443/> against <about:blank>
PASS Parsing: <https://foo:80/> against <about:blank>
PASS Parsing: <ftp://foo:21/> against <about:blank>
PASS Parsing: <ftp://foo:80/> against <about:blank>
PASS Parsing: <gopher://foo:70/> against <about:blank>
FAIL Parsing: <gopher://foo:70/> against <about:blank> assert_equals: href expected "gopher://foo/" but got "gopher://foo:70/"
PASS Parsing: <gopher://foo:443/> against <about:blank>
PASS Parsing: <ws://foo:80/> against <about:blank>
PASS Parsing: <ws://foo:81/> against <about:blank>
Expand All @@ -197,7 +197,7 @@ PASS Parsing: <https:/example.com/> against <about:blank>
PASS Parsing: <madeupscheme:/example.com/> against <about:blank>
PASS Parsing: <file:/example.com/> against <about:blank>
PASS Parsing: <ftps:/example.com/> against <about:blank>
PASS Parsing: <gopher:/example.com/> against <about:blank>
FAIL Parsing: <gopher:/example.com/> against <about:blank> assert_equals: href expected "gopher://example.com/" but got "gopher:/example.com/"
PASS Parsing: <ws:/example.com/> against <about:blank>
PASS Parsing: <wss:/example.com/> against <about:blank>
PASS Parsing: <data:/example.com/> against <about:blank>
Expand All @@ -208,7 +208,7 @@ PASS Parsing: <ftp:example.com/> against <about:blank>
PASS Parsing: <https:example.com/> against <about:blank>
PASS Parsing: <madeupscheme:example.com/> against <about:blank>
PASS Parsing: <ftps:example.com/> against <about:blank>
PASS Parsing: <gopher:example.com/> against <about:blank>
FAIL Parsing: <gopher:example.com/> against <about:blank> assert_equals: href expected "gopher://example.com/" but got "gopher:example.com/"
PASS Parsing: <ws:example.com/> against <about:blank>
PASS Parsing: <wss:example.com/> against <about:blank>
PASS Parsing: <data:example.com/> against <about:blank>
Expand Down
Expand Up @@ -68,7 +68,7 @@ PASS Parsing origin: <ftp:/example.com/> against <http://example.org/foo/bar>
PASS Parsing origin: <https:/example.com/> against <http://example.org/foo/bar>
FAIL Parsing origin: <madeupscheme:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
FAIL Parsing origin: <ftps:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
PASS Parsing origin: <gopher:/example.com/> against <http://example.org/foo/bar>
FAIL Parsing origin: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
PASS Parsing origin: <ws:/example.com/> against <http://example.org/foo/bar>
PASS Parsing origin: <wss:/example.com/> against <http://example.org/foo/bar>
PASS Parsing origin: <data:/example.com/> against <http://example.org/foo/bar>
Expand All @@ -79,7 +79,7 @@ PASS Parsing origin: <ftp:example.com/> against <http://example.org/foo/bar>
PASS Parsing origin: <https:example.com/> against <http://example.org/foo/bar>
FAIL Parsing origin: <madeupscheme:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
FAIL Parsing origin: <ftps:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
PASS Parsing origin: <gopher:example.com/> against <http://example.org/foo/bar>
FAIL Parsing origin: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
PASS Parsing origin: <ws:example.com/> against <http://example.org/foo/bar>
PASS Parsing origin: <wss:example.com/> against <http://example.org/foo/bar>
PASS Parsing origin: <data:example.com/> against <http://example.org/foo/bar>
Expand Down Expand Up @@ -144,7 +144,7 @@ PASS Parsing origin: <https://foo:443/> against <about:blank>
PASS Parsing origin: <https://foo:80/> against <about:blank>
PASS Parsing origin: <ftp://foo:21/> against <about:blank>
PASS Parsing origin: <ftp://foo:80/> against <about:blank>
PASS Parsing origin: <gopher://foo:70/> against <about:blank>
FAIL Parsing origin: <gopher://foo:70/> against <about:blank> assert_equals: origin expected "gopher://foo" but got "gopher://foo:70"
PASS Parsing origin: <gopher://foo:443/> against <about:blank>
PASS Parsing origin: <ws://foo:80/> against <about:blank>
PASS Parsing origin: <ws://foo:81/> against <about:blank>
Expand All @@ -159,7 +159,7 @@ PASS Parsing origin: <ftp:/example.com/> against <about:blank>
PASS Parsing origin: <https:/example.com/> against <about:blank>
FAIL Parsing origin: <madeupscheme:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
FAIL Parsing origin: <ftps:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
PASS Parsing origin: <gopher:/example.com/> against <about:blank>
FAIL Parsing origin: <gopher:/example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
PASS Parsing origin: <ws:/example.com/> against <about:blank>
PASS Parsing origin: <wss:/example.com/> against <about:blank>
PASS Parsing origin: <data:/example.com/> against <about:blank>
Expand All @@ -170,7 +170,7 @@ PASS Parsing origin: <ftp:example.com/> against <about:blank>
PASS Parsing origin: <https:example.com/> against <about:blank>
FAIL Parsing origin: <madeupscheme:example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
FAIL Parsing origin: <ftps:example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
PASS Parsing origin: <gopher:example.com/> against <about:blank>
FAIL Parsing origin: <gopher:example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
PASS Parsing origin: <ws:example.com/> against <about:blank>
PASS Parsing origin: <wss:example.com/> against <about:blank>
PASS Parsing origin: <data:example.com/> against <about:blank>
Expand Down

0 comments on commit cde3bee

Please sign in to comment.