Title: [249941] trunk
Revision
249941
Author
commit-qu...@webkit.org
Date
2019-09-16 22:39:18 -0700 (Mon, 16 Sep 2019)

Log Message

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

Patch by Alex Christensen <achristen...@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
https://github.com/whatwg/url/issues/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:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (249940 => 249941)


--- trunk/LayoutTests/ChangeLog	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/ChangeLog	2019-09-17 05:39:18 UTC (rev 249941)
@@ -1,3 +1,19 @@
+2019-09-16  Alex Christensen  <achristen...@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  <cdu...@apple.com>
 
         Unreviewed, rebaseline test after testharness.js update in r249918.

Modified: trunk/LayoutTests/fast/url/invalid-urls-utf8-expected.txt (249940 => 249941)


--- trunk/LayoutTests/fast/url/invalid-urls-utf8-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/fast/url/invalid-urls-utf8-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -24,7 +24,7 @@
 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

Modified: trunk/LayoutTests/fast/url/invalid-urls-utf8.html (249940 => 249941)


--- trunk/LayoutTests/fast/url/invalid-urls-utf8.html	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/fast/url/invalid-urls-utf8.html	2019-09-17 05:39:18 UTC (rev 249941)
@@ -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) {

Modified: trunk/LayoutTests/fast/url/segments-expected.txt (249940 => 249941)


--- trunk/LayoutTests/fast/url/segments-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/fast/url/segments-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -75,7 +75,7 @@
 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/","",""]'
@@ -87,7 +87,7 @@
 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/","",""]'

Modified: trunk/LayoutTests/fast/url/segments.html (249940 => 249941)


--- trunk/LayoutTests/fast/url/segments.html	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/fast/url/segments.html	2019-09-17 05:39:18 UTC (rev 249941)
@@ -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/","",""]],
@@ -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/","",""]],

Modified: trunk/LayoutTests/fast/url/standard-url-expected.txt (249940 => 249941)


--- trunk/LayoutTests/fast/url/standard-url-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/fast/url/standard-url-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -22,7 +22,7 @@
 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/'
@@ -38,7 +38,7 @@
 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/'
@@ -49,7 +49,7 @@
 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/'

Modified: trunk/LayoutTests/fast/url/standard-url.html (249940 => 249941)


--- trunk/LayoutTests/fast/url/standard-url.html	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/fast/url/standard-url.html	2019-09-17 05:39:18 UTC (rev 249941)
@@ -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/"],
@@ -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/"],
@@ -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/"],

Modified: trunk/LayoutTests/fetch/fetch-urls.json (249940 => 249941)


--- trunk/LayoutTests/fetch/fetch-urls.json	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/fetch/fetch-urls.json	2019-09-17 05:39:18 UTC (rev 249941)
@@ -949,7 +949,7 @@
   {
     "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": "",
@@ -1114,7 +1114,7 @@
   {
     "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": "",
@@ -2358,7 +2358,7 @@
   {
     "input": "gopher://foo:70/",
     "base": "about:blank",
-    "href": "gopher://foo/",
+    "href": "gopher://foo:70/",
     "origin": "gopher://foo",
     "protocol": "gopher:",
     "username": "",
@@ -2365,7 +2365,7 @@
     "password": "",
     "host": "foo",
     "hostname": "foo",
-    "port": "",
+    "port": "70",
     "pathname": "/",
     "search": "",
     "hash": ""
@@ -2597,7 +2597,7 @@
   {
     "input": "gopher:/example.com/",
     "base": "about:blank",
-    "href": "gopher://example.com/",
+    "href": "gopher:/example.com/",
     "origin": "gopher://example.com",
     "protocol": "gopher:",
     "username": "",
@@ -2762,7 +2762,7 @@
   {
     "input": "gopher:example.com/",
     "base": "about:blank",
-    "href": "gopher://example.com/",
+    "href": "gopher:example.com/",
     "origin": "gopher://example.com",
     "protocol": "gopher:",
     "username": "",

Modified: trunk/LayoutTests/http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate-expected.txt (249940 => 249941)


--- trunk/LayoutTests/http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -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 

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (249940 => 249941)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-09-17 05:39:18 UTC (rev 249941)
@@ -1,3 +1,18 @@
+2019-09-16  Alex Christensen  <achristen...@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  <cdu...@apple.com>
 
         Update testharness.js from upstream

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt (249940 => 249941)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -84,7 +84,7 @@
 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> 
@@ -95,7 +95,7 @@
 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> 
@@ -181,7 +181,7 @@
 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> 
@@ -197,7 +197,7 @@
 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> 
@@ -208,7 +208,7 @@
 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> 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt (249940 => 249941)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -68,7 +68,7 @@
 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> 
@@ -79,7 +79,7 @@
 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> 
@@ -144,7 +144,7 @@
 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> 
@@ -159,7 +159,7 @@
 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> 
@@ -170,7 +170,7 @@
 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> 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt (249940 => 249941)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -68,7 +68,7 @@
 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> 
@@ -79,7 +79,7 @@
 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> 
@@ -144,7 +144,7 @@
 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> 
@@ -159,7 +159,7 @@
 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> 
@@ -170,7 +170,7 @@
 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> 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt (249940 => 249941)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -84,7 +84,7 @@
 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> 
@@ -95,7 +95,7 @@
 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> 
@@ -181,7 +181,7 @@
 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> 
@@ -197,7 +197,7 @@
 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> 
@@ -208,7 +208,7 @@
 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> 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt (249940 => 249941)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -90,7 +90,7 @@
 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> 
@@ -101,7 +101,7 @@
 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> 
@@ -187,7 +187,7 @@
 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> 
@@ -203,7 +203,7 @@
 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> 
@@ -214,7 +214,7 @@
 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> 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-origin-expected.txt (249940 => 249941)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-origin-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-origin-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -68,7 +68,7 @@
 PASS Origin parsing: <https:/example.com/> against <http://example.org/foo/bar> 
 FAIL Origin parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
 FAIL Origin parsing: <ftps:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
-PASS Origin parsing: <gopher:/example.com/> against <http://example.org/foo/bar> 
+FAIL Origin parsing: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
 PASS Origin parsing: <ws:/example.com/> against <http://example.org/foo/bar> 
 PASS Origin parsing: <wss:/example.com/> against <http://example.org/foo/bar> 
 PASS Origin parsing: <data:/example.com/> against <http://example.org/foo/bar> 
@@ -79,7 +79,7 @@
 PASS Origin parsing: <https:example.com/> against <http://example.org/foo/bar> 
 FAIL Origin parsing: <madeupscheme:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
 FAIL Origin parsing: <ftps:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
-PASS Origin parsing: <gopher:example.com/> against <http://example.org/foo/bar> 
+FAIL Origin parsing: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
 PASS Origin parsing: <ws:example.com/> against <http://example.org/foo/bar> 
 PASS Origin parsing: <wss:example.com/> against <http://example.org/foo/bar> 
 PASS Origin parsing: <data:example.com/> against <http://example.org/foo/bar> 
@@ -144,7 +144,7 @@
 PASS Origin parsing: <https://foo:80/> against <about:blank> 
 PASS Origin parsing: <ftp://foo:21/> against <about:blank> 
 PASS Origin parsing: <ftp://foo:80/> against <about:blank> 
-PASS Origin parsing: <gopher://foo:70/> against <about:blank> 
+FAIL Origin parsing: <gopher://foo:70/> against <about:blank> assert_equals: origin expected "gopher://foo" but got "gopher://foo:70"
 PASS Origin parsing: <gopher://foo:443/> against <about:blank> 
 PASS Origin parsing: <ws://foo:80/> against <about:blank> 
 PASS Origin parsing: <ws://foo:81/> against <about:blank> 
@@ -159,7 +159,7 @@
 PASS Origin parsing: <https:/example.com/> against <about:blank> 
 FAIL Origin parsing: <madeupscheme:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
 FAIL Origin parsing: <ftps:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
-PASS Origin parsing: <gopher:/example.com/> against <about:blank> 
+FAIL Origin parsing: <gopher:/example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
 PASS Origin parsing: <ws:/example.com/> against <about:blank> 
 PASS Origin parsing: <wss:/example.com/> against <about:blank> 
 PASS Origin parsing: <data:/example.com/> against <about:blank> 
@@ -170,7 +170,7 @@
 PASS Origin parsing: <https:example.com/> against <about:blank> 
 FAIL Origin parsing: <madeupscheme:example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
 FAIL Origin parsing: <ftps:example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
-PASS Origin parsing: <gopher:example.com/> against <about:blank> 
+FAIL Origin parsing: <gopher:example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
 PASS Origin parsing: <ws:example.com/> against <about:blank> 
 PASS Origin parsing: <wss:example.com/> against <about:blank> 
 PASS Origin parsing: <data:example.com/> against <about:blank> 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt (249940 => 249941)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt	2019-09-17 05:39:18 UTC (rev 249941)
@@ -42,9 +42,9 @@
 PASS URL: Setting <file://localhost/>.protocol = 'http' Can’t switch from file URL with no host 
 FAIL <a>: Setting <file://localhost/>.protocol = 'http' Can’t switch from file URL with no host assert_equals: expected "file:///" but got "http:///"
 FAIL <area>: Setting <file://localhost/>.protocol = 'http' Can’t switch from file URL with no host assert_equals: expected "file:///" but got "http:///"
-FAIL URL: Setting <file:///test>.protocol = 'gopher' assert_equals: expected "file:///test" but got "gopher://test/"
-FAIL <a>: Setting <file:///test>.protocol = 'gopher' assert_equals: expected "file:///test" but got "gopher://test/"
-FAIL <area>: Setting <file:///test>.protocol = 'gopher' assert_equals: expected "file:///test" but got "gopher://test/"
+FAIL URL: Setting <file:///test>.protocol = 'gopher' assert_equals: expected "file:///test" but got "gopher:///test"
+FAIL <a>: Setting <file:///test>.protocol = 'gopher' assert_equals: expected "file:///test" but got "gopher:///test"
+FAIL <area>: Setting <file:///test>.protocol = 'gopher' assert_equals: expected "file:///test" but got "gopher:///test"
 PASS URL: Setting <file:>.protocol = 'wss' 
 FAIL <a>: Setting <file:>.protocol = 'wss' assert_equals: expected "file:///" but got "wss:///"
 FAIL <area>: Setting <file:>.protocol = 'wss' assert_equals: expected "file:///" but got "wss:///"
@@ -66,9 +66,9 @@
 FAIL URL: Setting <ssh://m...@example.net>.protocol = 'http' Can’t switch from non-special scheme to special assert_equals: expected "ssh://m...@example.net" but got "http://m...@example.net/"
 FAIL <a>: Setting <ssh://m...@example.net>.protocol = 'http' Can’t switch from non-special scheme to special assert_equals: expected "ssh://m...@example.net" but got "http://m...@example.net/"
 FAIL <area>: Setting <ssh://m...@example.net>.protocol = 'http' Can’t switch from non-special scheme to special assert_equals: expected "ssh://m...@example.net" but got "http://m...@example.net/"
-FAIL URL: Setting <ssh://m...@example.net>.protocol = 'gopher' assert_equals: expected "ssh://m...@example.net" but got "gopher://m...@example.net/"
-FAIL <a>: Setting <ssh://m...@example.net>.protocol = 'gopher' assert_equals: expected "ssh://m...@example.net" but got "gopher://m...@example.net/"
-FAIL <area>: Setting <ssh://m...@example.net>.protocol = 'gopher' assert_equals: expected "ssh://m...@example.net" but got "gopher://m...@example.net/"
+FAIL URL: Setting <ssh://m...@example.net>.protocol = 'gopher' assert_equals: expected "ssh://m...@example.net" but got "gopher://m...@example.net"
+FAIL <a>: Setting <ssh://m...@example.net>.protocol = 'gopher' assert_equals: expected "ssh://m...@example.net" but got "gopher://m...@example.net"
+FAIL <area>: Setting <ssh://m...@example.net>.protocol = 'gopher' assert_equals: expected "ssh://m...@example.net" but got "gopher://m...@example.net"
 PASS URL: Setting <ssh://m...@example.net>.protocol = 'file' 
 FAIL <a>: Setting <ssh://m...@example.net>.protocol = 'file' assert_equals: expected "ssh://m...@example.net" but got "file://m...@example.net"
 FAIL <area>: Setting <ssh://m...@example.net>.protocol = 'file' assert_equals: expected "ssh://m...@example.net" but got "file://m...@example.net"

Modified: trunk/Source/WTF/ChangeLog (249940 => 249941)


--- trunk/Source/WTF/ChangeLog	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/Source/WTF/ChangeLog	2019-09-17 05:39:18 UTC (rev 249941)
@@ -1,3 +1,20 @@
+2019-09-16  Alex Christensen  <achristen...@webkit.org>
+
+        Remove "gopher" from list of special schemes in URLParser
+        https://bugs.webkit.org/show_bug.cgi?id=201852
+
+        Reviewed by Simon Fraser.
+
+        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
+        https://github.com/whatwg/url/issues/342
+
+        * wtf/URLParser.cpp:
+        (WTF::URLParser::defaultPortForProtocol):
+        (WTF::scheme):
+        (WTF::URLParser::copyURLPartsUntil):
+        (WTF::URLParser::parse):
+
 2019-09-14  Yusuke Suzuki  <ysuz...@apple.com>
 
         Retire x86 32bit JIT support

Modified: trunk/Source/WTF/wtf/URLParser.cpp (249940 => 249941)


--- trunk/Source/WTF/wtf/URLParser.cpp	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/Source/WTF/wtf/URLParser.cpp	2019-09-17 05:39:18 UTC (rev 249941)
@@ -653,7 +653,6 @@
 Optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme)
 {
     static const uint16_t ftpPort = 21;
-    static const uint16_t gopherPort = 70;
     static const uint16_t httpPort = 80;
     static const uint16_t httpsPort = 443;
     static const uint16_t wsPort = 80;
@@ -695,15 +694,6 @@
         default:
             return WTF::nullopt;
         }
-    case 'g':
-        if (length == 6
-            && scheme[1] == 'o'
-            && scheme[2] == 'p'
-            && scheme[3] == 'h'
-            && scheme[4] == 'e'
-            && scheme[5] == 'r')
-            return gopherPort;
-        return WTF::nullopt;
     case 'f':
         if (length == 3
             && scheme[1] == 't'
@@ -720,7 +710,6 @@
     WSS,
     File,
     FTP,
-    Gopher,
     HTTP,
     HTTPS,
     NonSpecial
@@ -748,15 +737,6 @@
         default:
             return Scheme::NonSpecial;
         }
-    case 'g':
-        if (length == 6
-            && scheme[1] == 'o'
-            && scheme[2] == 'p'
-            && scheme[3] == 'h'
-            && scheme[4] == 'e'
-            && scheme[5] == 'r')
-            return Scheme::Gopher;
-        return Scheme::NonSpecial;
     case 'h':
         switch (length) {
         case 4:
@@ -919,7 +899,6 @@
         m_urlIsFile = true;
         FALLTHROUGH;
     case Scheme::FTP:
-    case Scheme::Gopher:
     case Scheme::HTTP:
     case Scheme::HTTPS:
         m_urlIsSpecial = true;
@@ -1292,7 +1271,6 @@
                     m_url.m_protocolIsInHTTPFamily = true;
                     FALLTHROUGH;
                 case Scheme::FTP:
-                case Scheme::Gopher:
                     m_urlIsSpecial = true;
                     if (base.protocolIs(urlScheme))
                         state = State::SpecialRelativeOrAuthority;

Modified: trunk/Tools/ChangeLog (249940 => 249941)


--- trunk/Tools/ChangeLog	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/Tools/ChangeLog	2019-09-17 05:39:18 UTC (rev 249941)
@@ -1,3 +1,16 @@
+2019-09-16  Alex Christensen  <achristen...@webkit.org>
+
+        Remove "gopher" from list of special schemes in URLParser
+        https://bugs.webkit.org/show_bug.cgi?id=201852
+
+        Reviewed by Simon Fraser.
+
+        * TestWebKitAPI/Tests/WTF/URLParser.cpp:
+        (TestWebKitAPI::TEST_F):
+        * TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp:
+        (TestWebKitAPI::TEST_F):
+        * TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:
+
 2019-09-16  Jonathan Bedard  <jbed...@apple.com>
 
         results.webkit.org: Shard result archives

Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp (249940 => 249941)


--- trunk/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp	2019-09-17 05:39:18 UTC (rev 249941)
@@ -1113,17 +1113,9 @@
         {"ftp", "", "", "host", 22, "/", "", "", "ftp://host:22/"},
         {"ftp", "", "", "host", 22, "", "", "", "ftp://host:22"});
     
-    checkURL("gOpHeR://host:70/", {"gopher", "", "", "host", 0, "/", "", "", "gopher://host/"});
-    checkURL("gopher://host:70/", {"gopher", "", "", "host", 0, "/", "", "", "gopher://host/"});
+    checkURL("gOpHeR://host:70/", {"gopher", "", "", "host", 70, "/", "", "", "gopher://host:70/"});
+    checkURL("gopher://host:70/", {"gopher", "", "", "host", 70, "/", "", "", "gopher://host:70/"});
     checkURL("gopher://host:71/", {"gopher", "", "", "host", 71, "/", "", "", "gopher://host:71/"});
-    // Spec, Chrome, Firefox, and URLParser have "/", URL::parse does not.
-    // Spec, Chrome, URLParser, URL::parse recognize gopher default port, Firefox does not.
-    checkURLDifferences("gopher://host:70",
-        {"gopher", "", "", "host", 0, "/", "", "", "gopher://host/"},
-        {"gopher", "", "", "host", 0, "", "", "", "gopher://host"});
-    checkURLDifferences("gopher://host:71",
-        {"gopher", "", "", "host", 71, "/", "", "", "gopher://host:71/"},
-        {"gopher", "", "", "host", 71, "", "", "", "gopher://host:71"});
     
     checkURL("hTtP://host:80", {"http", "", "", "host", 0, "/", "", "", "http://host/"});
     checkURL("http://host:80", {"http", "", "", "host", 0, "/", "", "", "http://host/"});

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp (249940 => 249941)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp	2019-09-17 05:39:18 UTC (rev 249941)
@@ -159,13 +159,13 @@
     checkURL(makeString("wss://host/path?", withUmlauts), &iso88591, {"wss", "", "", "host", 0, "/path", "%C3%9C%D0%B0%D1%91", "", "wss://host/path?%C3%9C%D0%B0%D1%91"});
     checkURL(makeString("asdf://host/path?", withUmlauts), &iso88591, {"asdf", "", "", "host", 0, "/path", "%C3%9C%D0%B0%D1%91", "", "asdf://host/path?%C3%9C%D0%B0%D1%91"});
     checkURL(makeString("https://host/path?", withUmlauts), &iso88591, {"https", "", "", "host", 0, "/path", "%DC%26%231072%3B%26%231105%3B", "", "https://host/path?%DC%26%231072%3B%26%231105%3B"});
-    checkURL(makeString("gopher://host/path?", withUmlauts), &iso88591, {"gopher", "", "", "host", 0, "/path", "%DC%26%231072%3B%26%231105%3B", "", "gopher://host/path?%DC%26%231072%3B%26%231105%3B"});
+    checkURL(makeString("gopher://host/path?", withUmlauts), &iso88591, {"gopher", "", "", "host", 0, "/path", "%C3%9C%D0%B0%D1%91", "", "gopher://host/path?%C3%9C%D0%B0%D1%91"});
     checkURL(makeString("/path?", withUmlauts, "#fragment"), "ws://example.com/", &iso88591, {"ws", "", "", "example.com", 0, "/path", "%C3%9C%D0%B0%D1%91", "fragment", "ws://example.com/path?%C3%9C%D0%B0%D1%91#fragment"});
     checkURL(makeString("/path?", withUmlauts, "#fragment"), "wss://example.com/", &iso88591, {"wss", "", "", "example.com", 0, "/path", "%C3%9C%D0%B0%D1%91", "fragment", "wss://example.com/path?%C3%9C%D0%B0%D1%91#fragment"});
     checkURL(makeString("/path?", withUmlauts, "#fragment"), "asdf://example.com/", &iso88591, {"asdf", "", "", "example.com", 0, "/path", "%C3%9C%D0%B0%D1%91", "fragment", "asdf://example.com/path?%C3%9C%D0%B0%D1%91#fragment"});
     checkURL(makeString("/path?", withUmlauts, "#fragment"), "https://example.com/", &iso88591, {"https", "", "", "example.com", 0, "/path", "%DC%26%231072%3B%26%231105%3B", "fragment", "https://example.com/path?%DC%26%231072%3B%26%231105%3B#fragment"});
-    checkURL(makeString("/path?", withUmlauts, "#fragment"), "gopher://example.com/", &iso88591, {"gopher", "", "", "example.com", 0, "/path", "%DC%26%231072%3B%26%231105%3B", "fragment", "gopher://example.com/path?%DC%26%231072%3B%26%231105%3B#fragment"});
-    checkURL(makeString("gopher://host/path?", withUmlauts, "#fragment"), "asdf://example.com/?doesntmatter", &iso88591, {"gopher", "", "", "host", 0, "/path", "%DC%26%231072%3B%26%231105%3B", "fragment", "gopher://host/path?%DC%26%231072%3B%26%231105%3B#fragment"});
+    checkURL(makeString("/path?", withUmlauts, "#fragment"), "gopher://example.com/", &iso88591, {"gopher", "", "", "example.com", 0, "/path", "%C3%9C%D0%B0%D1%91", "fragment", "gopher://example.com/path?%C3%9C%D0%B0%D1%91#fragment"});
+    checkURL(makeString("gopher://host/path?", withUmlauts, "#fragment"), "asdf://example.com/?doesntmatter", &iso88591, {"gopher", "", "", "host", 0, "/path", "%C3%9C%D0%B0%D1%91", "fragment", "gopher://host/path?%C3%9C%D0%B0%D1%91#fragment"});
     checkURL(makeString("asdf://host/path?", withUmlauts, "#fragment"), "http://example.com/?doesntmatter", &iso88591, {"asdf", "", "", "host", 0, "/path", "%C3%9C%D0%B0%D1%91", "fragment", "asdf://host/path?%C3%9C%D0%B0%D1%91#fragment"});
 
     checkURL("http://host/pa'th?qu'ery#fr'agment", nullptr, {"http", "", "", "host", 0, "/pa'th", "qu%27ery", "fr'agment", "http://host/pa'th?qu%27ery#fr'agment"});

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm (249940 => 249941)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm	2019-09-17 05:28:46 UTC (rev 249940)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm	2019-09-17 05:39:18 UTC (rev 249941)
@@ -209,7 +209,7 @@
     EXPECT_TRUE([[handler.get().stoppedURLs objectAtIndex:0] isEqual:[NSURL URLWithString:@"testing:main"]]);
 }
 
-static NSString *schemes[] = {
+static NSString *handledSchemes[] = {
     @"about",
     @"applewebdata",
     @"blob",
@@ -216,7 +216,6 @@
     @"data",
     @"file",
     @"ftp",
-    @"gopher",
     @"http",
     @"https",
     @"_javascript_",
@@ -234,12 +233,17 @@
 #endif
 };
 
+static NSString *notHandledSchemes[] = {
+    @"gopher",
+    @"my-custom-scheme",
+};
+
 TEST(URLSchemeHandler, BuiltinSchemes)
 {
     RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
     RetainPtr<SchemeHandler> handler = adoptNS([[SchemeHandler alloc] initWithData:nil mimeType:nil]);
 
-    for (NSString *scheme : schemes) {
+    for (NSString *scheme : handledSchemes) {
         EXPECT_TRUE([WKWebView handlesURLScheme:scheme]);
 
         bool exceptionRaised = false;
@@ -251,6 +255,17 @@
         }
         EXPECT_TRUE(exceptionRaised);
     }
+    for (NSString *scheme : notHandledSchemes) {
+        EXPECT_FALSE([WKWebView handlesURLScheme:scheme]);
+
+        bool exceptionRaised = false;
+        @try {
+            [configuration setURLSchemeHandler:handler.get() forURLScheme:scheme];
+        } @catch (NSException *exception) {
+            exceptionRaised = true;
+        }
+        EXPECT_FALSE(exceptionRaised);
+    }
 }
 
 static bool receivedRedirect;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to