Title: [261764] trunk
Revision
261764
Author
[email protected]
Date
2020-05-15 14:55:30 -0700 (Fri, 15 May 2020)

Log Message

Make host parser fail on ^
https://bugs.webkit.org/show_bug.cgi?id=211901

Patch by Alex Christensen <[email protected]> on 2020-05-15
Reviewed by Geoffrey Garen.

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/failure-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:
* web-platform-tests/url/url-origin-expected.txt:
* web-platform-tests/url/urltestdata.json:

Source/WTF:

This matches the behavior of Chrome and Firefox, and now the specification!
I updated the URL wpt data, and this introduces new PASSes.

* wtf/URLParser.cpp:
(WTF::isC0Control):
(WTF::isForbiddenHostCodePoint):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (261763 => 261764)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-05-15 21:55:30 UTC (rev 261764)
@@ -1,3 +1,19 @@
+2020-05-15  Alex Christensen  <[email protected]>
+
+        Make host parser fail on ^
+        https://bugs.webkit.org/show_bug.cgi?id=211901
+
+        Reviewed by Geoffrey Garen.
+
+        * 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/failure-expected.txt:
+        * web-platform-tests/url/url-constructor-expected.txt:
+        * web-platform-tests/url/url-origin-expected.txt:
+        * web-platform-tests/url/urltestdata.json:
+
 2020-05-12  Alexey Shvayka  <[email protected]>
 
         Implement @isConstructor bytecode intrinsic and bytecode for that

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt	2020-05-15 21:55:30 UTC (rev 261764)
@@ -85,7 +85,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> 
-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: <gopher:/example.com/> against <http://example.org/foo/bar> 
 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> 
@@ -96,7 +96,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> 
-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: <gopher:example.com/> against <http://example.org/foo/bar> 
 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> 
@@ -109,6 +109,7 @@
 PASS Parsing: <#β> against <http://example.org/foo/bar> 
 PASS Parsing: <data:text/html,test#test> against <http://example.org/foo/bar> 
 PASS Parsing: <tel:1234567890> against <http://example.org/foo/bar> 
+PASS Parsing: <ssh://example.com/foo/bar.git> against <http://example.org/> 
 PASS Parsing: <file:c:\foo\bar.html> against <file:///tmp/mock/path> 
 PASS Parsing: <  File:c|////foo\bar.html> against <file:///tmp/mock/path> 
 PASS Parsing: <C|/foo/bar> against <file:///tmp/mock/path> 
@@ -182,7 +183,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> 
-FAIL Parsing: <gopher://foo:70/> against <about:blank> assert_equals: href expected "gopher://foo/" but got "gopher://foo:70/"
+PASS Parsing: <gopher://foo:70/> against <about:blank> 
 PASS Parsing: <gopher://foo:443/> against <about:blank> 
 PASS Parsing: <ws://foo:80/> against <about:blank> 
 PASS Parsing: <ws://foo:81/> against <about:blank> 
@@ -198,7 +199,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> 
-FAIL Parsing: <gopher:/example.com/> against <about:blank> assert_equals: href expected "gopher://example.com/" but got "gopher:/example.com/"
+PASS Parsing: <gopher:/example.com/> against <about:blank> 
 PASS Parsing: <ws:/example.com/> against <about:blank> 
 PASS Parsing: <wss:/example.com/> against <about:blank> 
 PASS Parsing: <data:/example.com/> against <about:blank> 
@@ -209,7 +210,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> 
-FAIL Parsing: <gopher:example.com/> against <about:blank> assert_equals: href expected "gopher://example.com/" but got "gopher:example.com/"
+PASS Parsing: <gopher:example.com/> against <about:blank> 
 PASS Parsing: <ws:example.com/> against <about:blank> 
 PASS Parsing: <wss:example.com/> against <about:blank> 
 PASS Parsing: <data:example.com/> against <about:blank> 
@@ -308,6 +309,8 @@
 PASS Parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> 
 PASS Parsing: <https://@@@example> against <http://doesnotmatter/> 
 PASS Parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> 
+PASS Parsing: <http://host/?'> against <about:blank> 
+PASS Parsing: <notspecial://host/?'> against <about:blank> 
 PASS Parsing: </some/path> against <http://[email protected]/smth> 
 PASS Parsing: <> against <http://user:[email protected]:21/smth> 
 PASS Parsing: </some/path> against <http://user:[email protected]:21/smth> 
@@ -341,7 +344,6 @@
 PASS Parsing: <_javascript_:/../> against <about:blank> 
 PASS Parsing: <mailto:/../> against <about:blank> 
 PASS Parsing: <sc://ñ.test/> against <about:blank> 
-FAIL Parsing: <sc://!"$&'()*+,-.;<=>^_`{|}~/> against <about:blank> assert_equals: href expected "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/" but got "sc://\x1f!\"$&'()*+,-.;<=>^_`{|}~/"
 PASS Parsing: <sc://\0/> against <about:blank> 
 PASS Parsing: <sc:// /> against <about:blank> 
 PASS Parsing: <sc://%/> against <about:blank> 
@@ -357,6 +359,15 @@
 PASS Parsing: <sc::[email protected]> against <about:blank> 
 PASS Parsing: <wow:%NBD> against <about:blank> 
 PASS Parsing: <wow:%1G> against <about:blank> 
+FAIL Parsing: <wow:\x{FFFF}> against <about:blank> assert_equals: href expected "wow:%EF%BF%BF" but got "wow:%EF%BF%BD"
+PASS Parsing: <http://a<b> against <about:blank> 
+PASS Parsing: <http://a>b> against <about:blank> 
+PASS Parsing: <http://a^b> against <about:blank> 
+PASS Parsing: <non-special://a<b> against <about:blank> 
+PASS Parsing: <non-special://a>b> against <about:blank> 
+PASS Parsing: <non-special://a^b> against <about:blank> 
+PASS Parsing: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
+PASS Parsing: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
 PASS Parsing: <ftp://example.com%80/> against <about:blank> 
 PASS Parsing: <ftp://example.com%A0/> against <about:blank> 
 PASS Parsing: <https://example.com%80/> against <about:blank> 
@@ -454,6 +465,16 @@
 PASS Parsing: <file:> against <about:blank> 
 PASS Parsing: <file:?q=v> against <about:blank> 
 PASS Parsing: <file:#frag> against <about:blank> 
+PASS Parsing: <file:///Y:> against <about:blank> 
+PASS Parsing: <file:///Y:/> against <about:blank> 
+PASS Parsing: <file:///./Y> against <about:blank> 
+PASS Parsing: <file:///./Y:> against <about:blank> 
+PASS Parsing: <\\\.\Y:> against <about:blank> 
+PASS Parsing: <file:///y:> against <about:blank> 
+PASS Parsing: <file:///y:/> against <about:blank> 
+PASS Parsing: <file:///./y> against <about:blank> 
+PASS Parsing: <file:///./y:> against <about:blank> 
+PASS Parsing: <\\\.\y:> against <about:blank> 
 PASS Parsing: <http://[1:0::]> against <http://example.net/> 
 PASS Parsing: <http://[0:1:2:3:4:5:6:7:8]> against <http://example.net/> 
 PASS Parsing: <https://[0::0::0]> against <about:blank> 
@@ -513,14 +534,24 @@
 PASS Parsing: <http://example.org/test?%GH> against <about:blank> 
 PASS Parsing: <http://example.org/test?a#%EF> against <about:blank> 
 PASS Parsing: <http://example.org/test?a#%GH> against <about:blank> 
-FAIL Parsing: <test-a.html> against <a> assert_unreached: Expected URL to fail parsing Reached unreachable code
-FAIL Parsing: <test-a-slash.html> against <a/> assert_unreached: Expected URL to fail parsing Reached unreachable code
-FAIL Parsing: <test-a-slash-slash.html> against <a//> assert_unreached: Expected URL to fail parsing Reached unreachable code
+PASS Parsing: <a> against <about:blank> 
+PASS Parsing: <a/> against <about:blank> 
+PASS Parsing: <a//> against <about:blank> 
 PASS Parsing: <test-a-colon.html> against <a:> 
+PASS Parsing: <test-a-colon-b.html> against <a:b> 
 PASS Parsing: <test-a-colon-slash.html> against <a:/> 
 FAIL Parsing: <test-a-colon-slash-slash.html> against <a://> assert_equals: href expected "a:///test-a-colon-slash-slash.html" but got "a://test-a-colon-slash-slash.html"
-PASS Parsing: <test-a-colon-b.html> against <a:b> 
 PASS Parsing: <test-a-colon-slash-b.html> against <a:/b> 
 PASS Parsing: <test-a-colon-slash-slash-b.html> against <a://b> 
-FAIL Parsing: <http://example.org/test?a#b\0c> against <about:blank> assert_equals: href expected "http://example.org/test?a#bc" but got "http://example.org/test?a#b%00c"
+PASS Parsing: <http://example.org/test?a#b\0c> against <about:blank> 
+PASS Parsing: <non-spec://example.org/test?a#b\0c> against <about:blank> 
+PASS Parsing: <non-spec:/test?a#b\0c> against <about:blank> 
+PASS Parsing: <10.0.0.7:8080/foo.html> against <file:///some/dir/bar.html> 
+PASS Parsing: <a!@$*=/foo.html> against <file:///some/dir/bar.html> 
+PASS Parsing: <a1234567890-+.:foo/bar> against <http://example.com/dir/file> 
+PASS Parsing: <file://a­b/p> against <about:blank> 
+PASS Parsing: <file://a%C2%ADb/p> against <about:blank> 
+PASS Parsing: <file://­/p> against <about:blank> 
+PASS Parsing: <file://%C2%AD/p> against <about:blank> 
+FAIL Parsing: <file://xn--/p> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt	2020-05-15 21:55:30 UTC (rev 261764)
@@ -69,7 +69,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://"
-FAIL Parsing origin: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Parsing origin: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" 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> 
@@ -80,7 +80,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://"
-FAIL Parsing origin: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Parsing origin: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" 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> 
@@ -93,6 +93,7 @@
 PASS Parsing origin: <#β> against <http://example.org/foo/bar> 
 PASS Parsing origin: <data:text/html,test#test> against <http://example.org/foo/bar> 
 FAIL Parsing origin: <tel:1234567890> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "tel://"
+FAIL Parsing origin: <ssh://example.com/foo/bar.git> against <http://example.org/> assert_equals: origin expected "null" but got "ssh://example.com"
 PASS Parsing origin: <http://example.com/././foo> against <about:blank> 
 PASS Parsing origin: <http://example.com/./.foo> against <about:blank> 
 PASS Parsing origin: <http://example.com/foo/.> against <about:blank> 
@@ -145,8 +146,8 @@
 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> 
-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> 
+FAIL Parsing origin: <gopher://foo:70/> against <about:blank> assert_equals: origin expected "null" but got "gopher://foo:70"
+FAIL Parsing origin: <gopher://foo:443/> against <about:blank> assert_equals: origin expected "null" but got "gopher://foo:443"
 PASS Parsing origin: <ws://foo:80/> against <about:blank> 
 PASS Parsing origin: <ws://foo:81/> against <about:blank> 
 PASS Parsing origin: <ws://foo:443/> against <about:blank> 
@@ -160,7 +161,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://"
-FAIL Parsing origin: <gopher:/example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Parsing origin: <gopher:/example.com/> against <about:blank> assert_equals: origin expected "null" 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> 
@@ -171,7 +172,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://"
-FAIL Parsing origin: <gopher:example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Parsing origin: <gopher:example.com/> against <about:blank> assert_equals: origin expected "null" 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> 
@@ -228,6 +229,8 @@
 PASS Parsing origin: <https://@test@test@example:800/> against <http://doesnotmatter/> 
 PASS Parsing origin: <https://@@@example> against <http://doesnotmatter/> 
 PASS Parsing origin: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> 
+PASS Parsing origin: <http://host/?'> against <about:blank> 
+FAIL Parsing origin: <notspecial://host/?'> against <about:blank> assert_equals: origin expected "null" but got "notspecial://host"
 PASS Parsing origin: </some/path> against <http://[email protected]/smth> 
 PASS Parsing origin: <> against <http://user:[email protected]:21/smth> 
 PASS Parsing origin: </some/path> against <http://user:[email protected]:21/smth> 
@@ -253,12 +256,14 @@
 PASS Parsing origin: <_javascript_:/../> against <about:blank> 
 FAIL Parsing origin: <mailto:/../> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
 FAIL Parsing origin: <sc://ñ.test/> against <about:blank> assert_equals: origin expected "null" but got "sc://%c3%b1.test"
-PASS Parsing origin: <sc://!"$&'()*+,-.;<=>^_`{|}~/> against <about:blank> 
 FAIL Parsing origin: <x> against <sc://ñ> assert_equals: origin expected "null" but got "sc://%c3%b1"
 FAIL Parsing origin: <sc:\../> against <about:blank> assert_equals: origin expected "null" but got "sc://"
 FAIL Parsing origin: <sc::[email protected]> against <about:blank> assert_equals: origin expected "null" but got "sc://"
 FAIL Parsing origin: <wow:%NBD> against <about:blank> assert_equals: origin expected "null" but got "wow://"
 FAIL Parsing origin: <wow:%1G> against <about:blank> assert_equals: origin expected "null" but got "wow://"
+FAIL Parsing origin: <wow:\x{FFFF}> against <about:blank> assert_equals: origin expected "null" but got "wow://"
+PASS Parsing origin: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
+FAIL Parsing origin: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{|}~"
 PASS Parsing origin: <ftp://%e2%98%83> against <about:blank> 
 PASS Parsing origin: <https://%e2%98%83> against <about:blank> 
 PASS Parsing origin: <http://127.0.0.1:10100/relative_import.html> against <about:blank> 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt	2020-05-15 21:55:30 UTC (rev 261764)
@@ -69,7 +69,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://"
-FAIL Parsing origin: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Parsing origin: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" 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> 
@@ -80,7 +80,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://"
-FAIL Parsing origin: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Parsing origin: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" 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> 
@@ -93,6 +93,7 @@
 PASS Parsing origin: <#β> against <http://example.org/foo/bar> 
 PASS Parsing origin: <data:text/html,test#test> against <http://example.org/foo/bar> 
 FAIL Parsing origin: <tel:1234567890> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "tel://"
+FAIL Parsing origin: <ssh://example.com/foo/bar.git> against <http://example.org/> assert_equals: origin expected "null" but got "ssh://example.com"
 PASS Parsing origin: <http://example.com/././foo> against <about:blank> 
 PASS Parsing origin: <http://example.com/./.foo> against <about:blank> 
 PASS Parsing origin: <http://example.com/foo/.> against <about:blank> 
@@ -145,8 +146,8 @@
 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> 
-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> 
+FAIL Parsing origin: <gopher://foo:70/> against <about:blank> assert_equals: origin expected "null" but got "gopher://foo:70"
+FAIL Parsing origin: <gopher://foo:443/> against <about:blank> assert_equals: origin expected "null" but got "gopher://foo:443"
 PASS Parsing origin: <ws://foo:80/> against <about:blank> 
 PASS Parsing origin: <ws://foo:81/> against <about:blank> 
 PASS Parsing origin: <ws://foo:443/> against <about:blank> 
@@ -160,7 +161,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://"
-FAIL Parsing origin: <gopher:/example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Parsing origin: <gopher:/example.com/> against <about:blank> assert_equals: origin expected "null" 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> 
@@ -171,7 +172,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://"
-FAIL Parsing origin: <gopher:example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Parsing origin: <gopher:example.com/> against <about:blank> assert_equals: origin expected "null" 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> 
@@ -228,6 +229,8 @@
 PASS Parsing origin: <https://@test@test@example:800/> against <http://doesnotmatter/> 
 PASS Parsing origin: <https://@@@example> against <http://doesnotmatter/> 
 PASS Parsing origin: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> 
+PASS Parsing origin: <http://host/?'> against <about:blank> 
+FAIL Parsing origin: <notspecial://host/?'> against <about:blank> assert_equals: origin expected "null" but got "notspecial://host"
 PASS Parsing origin: </some/path> against <http://[email protected]/smth> 
 PASS Parsing origin: <> against <http://user:[email protected]:21/smth> 
 PASS Parsing origin: </some/path> against <http://user:[email protected]:21/smth> 
@@ -253,12 +256,14 @@
 PASS Parsing origin: <_javascript_:/../> against <about:blank> 
 FAIL Parsing origin: <mailto:/../> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
 FAIL Parsing origin: <sc://ñ.test/> against <about:blank> assert_equals: origin expected "null" but got "sc://%c3%b1.test"
-PASS Parsing origin: <sc://!"$&'()*+,-.;<=>^_`{|}~/> against <about:blank> 
 FAIL Parsing origin: <x> against <sc://ñ> assert_equals: origin expected "null" but got "sc://%c3%b1"
 FAIL Parsing origin: <sc:\../> against <about:blank> assert_equals: origin expected "null" but got "sc://"
 FAIL Parsing origin: <sc::[email protected]> against <about:blank> assert_equals: origin expected "null" but got "sc://"
 FAIL Parsing origin: <wow:%NBD> against <about:blank> assert_equals: origin expected "null" but got "wow://"
 FAIL Parsing origin: <wow:%1G> against <about:blank> assert_equals: origin expected "null" but got "wow://"
+FAIL Parsing origin: <wow:\x{FFFF}> against <about:blank> assert_equals: origin expected "null" but got "wow://"
+PASS Parsing origin: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
+FAIL Parsing origin: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{|}~"
 PASS Parsing origin: <ftp://%e2%98%83> against <about:blank> 
 PASS Parsing origin: <https://%e2%98%83> against <about:blank> 
 PASS Parsing origin: <http://127.0.0.1:10100/relative_import.html> against <about:blank> 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt	2020-05-15 21:55:30 UTC (rev 261764)
@@ -85,7 +85,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> 
-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: <gopher:/example.com/> against <http://example.org/foo/bar> 
 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> 
@@ -96,7 +96,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> 
-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: <gopher:example.com/> against <http://example.org/foo/bar> 
 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> 
@@ -109,6 +109,7 @@
 PASS Parsing: <#β> against <http://example.org/foo/bar> 
 PASS Parsing: <data:text/html,test#test> against <http://example.org/foo/bar> 
 PASS Parsing: <tel:1234567890> against <http://example.org/foo/bar> 
+PASS Parsing: <ssh://example.com/foo/bar.git> against <http://example.org/> 
 PASS Parsing: <file:c:\foo\bar.html> against <file:///tmp/mock/path> 
 PASS Parsing: <  File:c|////foo\bar.html> against <file:///tmp/mock/path> 
 PASS Parsing: <C|/foo/bar> against <file:///tmp/mock/path> 
@@ -182,7 +183,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> 
-FAIL Parsing: <gopher://foo:70/> against <about:blank> assert_equals: href expected "gopher://foo/" but got "gopher://foo:70/"
+PASS Parsing: <gopher://foo:70/> against <about:blank> 
 PASS Parsing: <gopher://foo:443/> against <about:blank> 
 PASS Parsing: <ws://foo:80/> against <about:blank> 
 PASS Parsing: <ws://foo:81/> against <about:blank> 
@@ -198,7 +199,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> 
-FAIL Parsing: <gopher:/example.com/> against <about:blank> assert_equals: href expected "gopher://example.com/" but got "gopher:/example.com/"
+PASS Parsing: <gopher:/example.com/> against <about:blank> 
 PASS Parsing: <ws:/example.com/> against <about:blank> 
 PASS Parsing: <wss:/example.com/> against <about:blank> 
 PASS Parsing: <data:/example.com/> against <about:blank> 
@@ -209,7 +210,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> 
-FAIL Parsing: <gopher:example.com/> against <about:blank> assert_equals: href expected "gopher://example.com/" but got "gopher:example.com/"
+PASS Parsing: <gopher:example.com/> against <about:blank> 
 PASS Parsing: <ws:example.com/> against <about:blank> 
 PASS Parsing: <wss:example.com/> against <about:blank> 
 PASS Parsing: <data:example.com/> against <about:blank> 
@@ -308,6 +309,8 @@
 PASS Parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> 
 PASS Parsing: <https://@@@example> against <http://doesnotmatter/> 
 PASS Parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> 
+PASS Parsing: <http://host/?'> against <about:blank> 
+PASS Parsing: <notspecial://host/?'> against <about:blank> 
 PASS Parsing: </some/path> against <http://[email protected]/smth> 
 PASS Parsing: <> against <http://user:[email protected]:21/smth> 
 PASS Parsing: </some/path> against <http://user:[email protected]:21/smth> 
@@ -341,7 +344,6 @@
 PASS Parsing: <_javascript_:/../> against <about:blank> 
 PASS Parsing: <mailto:/../> against <about:blank> 
 PASS Parsing: <sc://ñ.test/> against <about:blank> 
-FAIL Parsing: <sc://!"$&'()*+,-.;<=>^_`{|}~/> against <about:blank> assert_equals: href expected "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/" but got "sc://\x1f!\"$&'()*+,-.;<=>^_`{|}~/"
 PASS Parsing: <sc://\0/> against <about:blank> 
 PASS Parsing: <sc:// /> against <about:blank> 
 PASS Parsing: <sc://%/> against <about:blank> 
@@ -357,6 +359,15 @@
 PASS Parsing: <sc::[email protected]> against <about:blank> 
 PASS Parsing: <wow:%NBD> against <about:blank> 
 PASS Parsing: <wow:%1G> against <about:blank> 
+FAIL Parsing: <wow:\x{FFFF}> against <about:blank> assert_equals: href expected "wow:%EF%BF%BF" but got "wow:%EF%BF%BD"
+PASS Parsing: <http://a<b> against <about:blank> 
+PASS Parsing: <http://a>b> against <about:blank> 
+PASS Parsing: <http://a^b> against <about:blank> 
+PASS Parsing: <non-special://a<b> against <about:blank> 
+PASS Parsing: <non-special://a>b> against <about:blank> 
+PASS Parsing: <non-special://a^b> against <about:blank> 
+PASS Parsing: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
+PASS Parsing: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
 PASS Parsing: <ftp://example.com%80/> against <about:blank> 
 PASS Parsing: <ftp://example.com%A0/> against <about:blank> 
 PASS Parsing: <https://example.com%80/> against <about:blank> 
@@ -454,6 +465,16 @@
 PASS Parsing: <file:> against <about:blank> 
 PASS Parsing: <file:?q=v> against <about:blank> 
 PASS Parsing: <file:#frag> against <about:blank> 
+PASS Parsing: <file:///Y:> against <about:blank> 
+PASS Parsing: <file:///Y:/> against <about:blank> 
+PASS Parsing: <file:///./Y> against <about:blank> 
+PASS Parsing: <file:///./Y:> against <about:blank> 
+PASS Parsing: <\\\.\Y:> against <about:blank> 
+PASS Parsing: <file:///y:> against <about:blank> 
+PASS Parsing: <file:///y:/> against <about:blank> 
+PASS Parsing: <file:///./y> against <about:blank> 
+PASS Parsing: <file:///./y:> against <about:blank> 
+PASS Parsing: <\\\.\y:> against <about:blank> 
 PASS Parsing: <http://[1:0::]> against <http://example.net/> 
 PASS Parsing: <http://[0:1:2:3:4:5:6:7:8]> against <http://example.net/> 
 PASS Parsing: <https://[0::0::0]> against <about:blank> 
@@ -513,14 +534,24 @@
 PASS Parsing: <http://example.org/test?%GH> against <about:blank> 
 PASS Parsing: <http://example.org/test?a#%EF> against <about:blank> 
 PASS Parsing: <http://example.org/test?a#%GH> against <about:blank> 
-FAIL Parsing: <test-a.html> against <a> assert_unreached: Expected URL to fail parsing Reached unreachable code
-FAIL Parsing: <test-a-slash.html> against <a/> assert_unreached: Expected URL to fail parsing Reached unreachable code
-FAIL Parsing: <test-a-slash-slash.html> against <a//> assert_unreached: Expected URL to fail parsing Reached unreachable code
+PASS Parsing: <a> against <about:blank> 
+PASS Parsing: <a/> against <about:blank> 
+PASS Parsing: <a//> against <about:blank> 
 PASS Parsing: <test-a-colon.html> against <a:> 
+PASS Parsing: <test-a-colon-b.html> against <a:b> 
 PASS Parsing: <test-a-colon-slash.html> against <a:/> 
 FAIL Parsing: <test-a-colon-slash-slash.html> against <a://> assert_equals: href expected "a:///test-a-colon-slash-slash.html" but got "a://test-a-colon-slash-slash.html"
-PASS Parsing: <test-a-colon-b.html> against <a:b> 
 PASS Parsing: <test-a-colon-slash-b.html> against <a:/b> 
 PASS Parsing: <test-a-colon-slash-slash-b.html> against <a://b> 
-FAIL Parsing: <http://example.org/test?a#b\0c> against <about:blank> assert_equals: href expected "http://example.org/test?a#bc" but got "http://example.org/test?a#b%00c"
+PASS Parsing: <http://example.org/test?a#b\0c> against <about:blank> 
+PASS Parsing: <non-spec://example.org/test?a#b\0c> against <about:blank> 
+PASS Parsing: <non-spec:/test?a#b\0c> against <about:blank> 
+PASS Parsing: <10.0.0.7:8080/foo.html> against <file:///some/dir/bar.html> 
+PASS Parsing: <a!@$*=/foo.html> against <file:///some/dir/bar.html> 
+PASS Parsing: <a1234567890-+.:foo/bar> against <http://example.com/dir/file> 
+PASS Parsing: <file://a­b/p> against <about:blank> 
+PASS Parsing: <file://a%C2%ADb/p> against <about:blank> 
+PASS Parsing: <file://­/p> against <about:blank> 
+PASS Parsing: <file://%C2%AD/p> against <about:blank> 
+FAIL Parsing: <file://xn--/p> against <about:blank> assert_unreached: Expected URL to fail parsing Reached unreachable code
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt (261763 => 261764)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/failure-expected.txt	2020-05-15 21:55:30 UTC (rev 261764)
@@ -1,4 +1,10 @@
 CONSOLE MESSAGE: Not allowed to load local resource: example:1
+Blocked access to external URL http://./Y:
+CONSOLE MESSAGE: Beacon API cannot load http://./Y: due to access control checks.
+Blocked access to external URL http://./y:
+CONSOLE MESSAGE: Beacon API cannot load http://./y: due to access control checks.
+CONSOLE MESSAGE: Not allowed to load local resource: p
+CONSOLE MESSAGE: Not allowed to load local resource: p
 
 PASS Loading data… 
 FAIL URL's href: file://example:1/ should throw assert_throws: function "() => url.href = "" did not throw
@@ -161,6 +167,36 @@
 PASS sendBeacon(): sc://]/ should throw 
 FAIL Location's href: sc://]/ should throw assert_throws: function "() => self[0].location = test.input" did not throw
 PASS window.open(): sc://]/ should throw 
+PASS URL's href: http://a<b should throw 
+PASS XHR: http://a<b should throw 
+PASS sendBeacon(): http://a<b should throw 
+FAIL Location's href: http://a<b should throw assert_throws: function "() => self[0].location = test.input" did not throw
+PASS window.open(): http://a<b should throw 
+PASS URL's href: http://a>b should throw 
+PASS XHR: http://a>b should throw 
+PASS sendBeacon(): http://a>b should throw 
+FAIL Location's href: http://a>b should throw assert_throws: function "() => self[0].location = test.input" did not throw
+PASS window.open(): http://a>b should throw 
+PASS URL's href: http://a^b should throw 
+PASS XHR: http://a^b should throw 
+PASS sendBeacon(): http://a^b should throw 
+FAIL Location's href: http://a^b should throw assert_throws: function "() => self[0].location = test.input" did not throw
+PASS window.open(): http://a^b should throw 
+PASS URL's href: non-special://a<b should throw 
+PASS XHR: non-special://a<b should throw 
+PASS sendBeacon(): non-special://a<b should throw 
+FAIL Location's href: non-special://a<b should throw assert_throws: function "() => self[0].location = test.input" did not throw
+PASS window.open(): non-special://a<b should throw 
+PASS URL's href: non-special://a>b should throw 
+PASS XHR: non-special://a>b should throw 
+PASS sendBeacon(): non-special://a>b should throw 
+FAIL Location's href: non-special://a>b should throw assert_throws: function "() => self[0].location = test.input" did not throw
+PASS window.open(): non-special://a>b should throw 
+PASS URL's href: non-special://a^b should throw 
+PASS XHR: non-special://a^b should throw 
+PASS sendBeacon(): non-special://a^b should throw 
+FAIL Location's href: non-special://a^b should throw assert_throws: function "() => self[0].location = test.input" did not throw
+PASS window.open(): non-special://a^b should throw 
 PASS URL's href: ftp://example.com%80/ should throw 
 PASS XHR: ftp://example.com%80/ should throw 
 PASS sendBeacon(): ftp://example.com%80/ should throw 
@@ -191,6 +227,16 @@
 PASS sendBeacon(): https://256.0.0.1/test should throw 
 FAIL Location's href: https://256.0.0.1/test should throw assert_throws: function "() => self[0].location = test.input" did not throw
 PASS window.open(): https://256.0.0.1/test should throw 
+PASS URL's href: \\\.\Y: should throw 
+FAIL XHR: \\\.\Y: should throw assert_throws: function "() => client.open("GET", test.input)" did not throw
+FAIL sendBeacon(): \\\.\Y: should throw assert_throws: function "() => self.navigator.sendBeacon(test.input)" did not throw
+FAIL Location's href: \\\.\Y: should throw assert_throws: function "() => self[0].location = test.input" did not throw
+FAIL window.open(): \\\.\Y: should throw assert_throws: function "() => self.open(test.input).close()" did not throw
+PASS URL's href: \\\.\y: should throw 
+FAIL XHR: \\\.\y: should throw assert_throws: function "() => client.open("GET", test.input)" did not throw
+FAIL sendBeacon(): \\\.\y: should throw assert_throws: function "() => self.navigator.sendBeacon(test.input)" did not throw
+FAIL Location's href: \\\.\y: should throw assert_throws: function "() => self[0].location = test.input" did not throw
+FAIL window.open(): \\\.\y: should throw assert_throws: function "() => self.open(test.input).close()" did not throw
 PASS URL's href: https://[0::0::0] should throw 
 PASS XHR: https://[0::0::0] should throw 
 PASS sendBeacon(): https://[0::0::0] should throw 
@@ -246,4 +292,34 @@
 PASS sendBeacon(): http://[::127.0.0.0.1] should throw 
 FAIL Location's href: http://[::127.0.0.0.1] should throw assert_throws: function "() => self[0].location = test.input" did not throw
 PASS window.open(): http://[::127.0.0.0.1] should throw 
+PASS URL's href: a should throw 
+FAIL XHR: a should throw assert_throws: function "() => client.open("GET", test.input)" did not throw
+FAIL sendBeacon(): a should throw assert_throws: function "() => self.navigator.sendBeacon(test.input)" did not throw
+FAIL Location's href: a should throw assert_throws: function "() => self[0].location = test.input" did not throw
+FAIL window.open(): a should throw assert_throws: function "() => self.open(test.input).close()" did not throw
+PASS URL's href: a/ should throw 
+FAIL XHR: a/ should throw assert_throws: function "() => client.open("GET", test.input)" did not throw
+FAIL sendBeacon(): a/ should throw assert_throws: function "() => self.navigator.sendBeacon(test.input)" did not throw
+FAIL Location's href: a/ should throw assert_throws: function "() => self[0].location = test.input" did not throw
+FAIL window.open(): a/ should throw assert_throws: function "() => self.open(test.input).close()" did not throw
+PASS URL's href: a// should throw 
+FAIL XHR: a// should throw assert_throws: function "() => client.open("GET", test.input)" did not throw
+FAIL sendBeacon(): a// should throw assert_throws: function "() => self.navigator.sendBeacon(test.input)" did not throw
+FAIL Location's href: a// should throw assert_throws: function "() => self[0].location = test.input" did not throw
+FAIL window.open(): a// should throw assert_throws: function "() => self.open(test.input).close()" did not throw
+PASS URL's href: file://­/p should throw 
+PASS XHR: file://­/p should throw 
+PASS sendBeacon(): file://­/p should throw 
+FAIL Location's href: file://­/p should throw assert_throws: function "() => self[0].location = test.input" did not throw
+PASS window.open(): file://­/p should throw 
+PASS URL's href: file://%C2%AD/p should throw 
+PASS XHR: file://%C2%AD/p should throw 
+PASS sendBeacon(): file://%C2%AD/p should throw 
+FAIL Location's href: file://%C2%AD/p should throw assert_throws: function "() => self[0].location = test.input" did not throw
+PASS window.open(): file://%C2%AD/p should throw 
+FAIL URL's href: file://xn--/p should throw assert_throws: function "() => url.href = "" did not throw
+FAIL XHR: file://xn--/p should throw assert_throws: function "() => client.open("GET", test.input)" did not throw
+PASS sendBeacon(): file://xn--/p should throw 
+FAIL Location's href: file://xn--/p should throw assert_throws: function "() => self[0].location = test.input" did not throw
+FAIL window.open(): file://xn--/p should throw assert_throws: function "() => self.open(test.input).close()" did not throw
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt	2020-05-15 21:55:30 UTC (rev 261764)
@@ -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> 
-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: <gopher:/example.com/> against <http://example.org/foo/bar> 
 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> 
-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: <gopher:example.com/> against <http://example.org/foo/bar> 
 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> 
@@ -114,6 +114,7 @@
 PASS Parsing: <#β> against <http://example.org/foo/bar> 
 PASS Parsing: <data:text/html,test#test> against <http://example.org/foo/bar> 
 PASS Parsing: <tel:1234567890> against <http://example.org/foo/bar> 
+PASS Parsing: <ssh://example.com/foo/bar.git> against <http://example.org/> 
 PASS Parsing: <file:c:\foo\bar.html> against <file:///tmp/mock/path> 
 PASS Parsing: <  File:c|////foo\bar.html> against <file:///tmp/mock/path> 
 PASS Parsing: <C|/foo/bar> against <file:///tmp/mock/path> 
@@ -187,7 +188,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> 
-FAIL Parsing: <gopher://foo:70/> against <about:blank> assert_equals: href expected "gopher://foo/" but got "gopher://foo:70/"
+PASS Parsing: <gopher://foo:70/> against <about:blank> 
 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 +204,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> 
-FAIL Parsing: <gopher:/example.com/> against <about:blank> assert_equals: href expected "gopher://example.com/" but got "gopher:/example.com/"
+PASS Parsing: <gopher:/example.com/> against <about:blank> 
 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 +215,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> 
-FAIL Parsing: <gopher:example.com/> against <about:blank> assert_equals: href expected "gopher://example.com/" but got "gopher:example.com/"
+PASS Parsing: <gopher:example.com/> against <about:blank> 
 PASS Parsing: <ws:example.com/> against <about:blank> 
 PASS Parsing: <wss:example.com/> against <about:blank> 
 PASS Parsing: <data:example.com/> against <about:blank> 
@@ -313,6 +314,8 @@
 PASS Parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> 
 PASS Parsing: <https://@@@example> against <http://doesnotmatter/> 
 PASS Parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> 
+PASS Parsing: <http://host/?'> against <about:blank> 
+PASS Parsing: <notspecial://host/?'> against <about:blank> 
 PASS Parsing: </some/path> against <http://[email protected]/smth> 
 PASS Parsing: <> against <http://user:[email protected]:21/smth> 
 PASS Parsing: </some/path> against <http://user:[email protected]:21/smth> 
@@ -346,7 +349,6 @@
 PASS Parsing: <_javascript_:/../> against <about:blank> 
 PASS Parsing: <mailto:/../> against <about:blank> 
 PASS Parsing: <sc://ñ.test/> against <about:blank> 
-FAIL Parsing: <sc://!"$&'()*+,-.;<=>^_`{|}~/> against <about:blank> Type error
 PASS Parsing: <sc://\0/> against <about:blank> 
 PASS Parsing: <sc:// /> against <about:blank> 
 PASS Parsing: <sc://%/> against <about:blank> 
@@ -362,6 +364,15 @@
 PASS Parsing: <sc::[email protected]> against <about:blank> 
 PASS Parsing: <wow:%NBD> against <about:blank> 
 PASS Parsing: <wow:%1G> against <about:blank> 
+FAIL Parsing: <wow:\x{FFFF}> against <about:blank> assert_equals: href expected "wow:%EF%BF%BF" but got "wow:%EF%BF%BD"
+PASS Parsing: <http://a<b> against <about:blank> 
+PASS Parsing: <http://a>b> against <about:blank> 
+PASS Parsing: <http://a^b> against <about:blank> 
+PASS Parsing: <non-special://a<b> against <about:blank> 
+PASS Parsing: <non-special://a>b> against <about:blank> 
+PASS Parsing: <non-special://a^b> against <about:blank> 
+PASS Parsing: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
+PASS Parsing: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
 PASS Parsing: <ftp://example.com%80/> against <about:blank> 
 PASS Parsing: <ftp://example.com%A0/> against <about:blank> 
 PASS Parsing: <https://example.com%80/> against <about:blank> 
@@ -461,6 +472,16 @@
 PASS Parsing: <file:> against <about:blank> 
 PASS Parsing: <file:?q=v> against <about:blank> 
 PASS Parsing: <file:#frag> against <about:blank> 
+PASS Parsing: <file:///Y:> against <about:blank> 
+PASS Parsing: <file:///Y:/> against <about:blank> 
+PASS Parsing: <file:///./Y> against <about:blank> 
+PASS Parsing: <file:///./Y:> against <about:blank> 
+PASS Parsing: <\\\.\Y:> against <about:blank> 
+PASS Parsing: <file:///y:> against <about:blank> 
+PASS Parsing: <file:///y:/> against <about:blank> 
+PASS Parsing: <file:///./y> against <about:blank> 
+PASS Parsing: <file:///./y:> against <about:blank> 
+PASS Parsing: <\\\.\y:> against <about:blank> 
 PASS Parsing: <http://[1:0::]> against <http://example.net/> 
 PASS Parsing: <http://[0:1:2:3:4:5:6:7:8]> against <http://example.net/> 
 PASS Parsing: <https://[0::0::0]> against <about:blank> 
@@ -520,14 +541,26 @@
 PASS Parsing: <http://example.org/test?%GH> against <about:blank> 
 PASS Parsing: <http://example.org/test?a#%EF> against <about:blank> 
 PASS Parsing: <http://example.org/test?a#%GH> against <about:blank> 
-PASS Parsing: <test-a.html> against <a> 
-PASS Parsing: <test-a-slash.html> against <a/> 
-PASS Parsing: <test-a-slash-slash.html> against <a//> 
+PASS Parsing: <a> against <about:blank> 
+PASS Parsing: <a/> against <about:blank> 
+PASS Parsing: <a//> against <about:blank> 
 PASS Parsing: <test-a-colon.html> against <a:> 
+PASS Parsing: <test-a-colon-b.html> against <a:b> 
 PASS Parsing: <test-a-colon-slash.html> against <a:/> 
 FAIL Parsing: <test-a-colon-slash-slash.html> against <a://> assert_equals: href expected "a:///test-a-colon-slash-slash.html" but got "a://test-a-colon-slash-slash.html"
-PASS Parsing: <test-a-colon-b.html> against <a:b> 
 PASS Parsing: <test-a-colon-slash-b.html> against <a:/b> 
 PASS Parsing: <test-a-colon-slash-slash-b.html> against <a://b> 
-FAIL Parsing: <http://example.org/test?a#b\0c> against <about:blank> assert_equals: href expected "http://example.org/test?a#bc" but got "http://example.org/test?a#b%00c"
+PASS Parsing: <http://example.org/test?a#b\0c> against <about:blank> 
+PASS Parsing: <non-spec://example.org/test?a#b\0c> against <about:blank> 
+PASS Parsing: <non-spec:/test?a#b\0c> against <about:blank> 
+PASS Parsing: <10.0.0.7:8080/foo.html> against <file:///some/dir/bar.html> 
+PASS Parsing: <a!@$*=/foo.html> against <file:///some/dir/bar.html> 
+PASS Parsing: <a1234567890-+.:foo/bar> against <http://example.com/dir/file> 
+PASS Parsing: <file://a­b/p> against <about:blank> 
+PASS Parsing: <file://a%C2%ADb/p> against <about:blank> 
+PASS Parsing: <file://­/p> against <about:blank> 
+PASS Parsing: <file://%C2%AD/p> against <about:blank> 
+FAIL Parsing: <file://xn--/p> against <about:blank> assert_throws: function "function () {
+          bURL(expected.input, expected.base)
+        }" did not throw
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-origin-expected.txt	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-origin-expected.txt	2020-05-15 21:55:30 UTC (rev 261764)
@@ -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://"
-FAIL Origin parsing: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Origin parsing: <gopher:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" 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://"
-FAIL Origin parsing: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Origin parsing: <gopher:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" 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> 
@@ -92,6 +92,7 @@
 PASS Origin parsing: <#β> against <http://example.org/foo/bar> 
 PASS Origin parsing: <data:text/html,test#test> against <http://example.org/foo/bar> 
 FAIL Origin parsing: <tel:1234567890> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "tel://"
+FAIL Origin parsing: <ssh://example.com/foo/bar.git> against <http://example.org/> assert_equals: origin expected "null" but got "ssh://example.com"
 PASS Origin parsing: <http://example.com/././foo> against <about:blank> 
 PASS Origin parsing: <http://example.com/./.foo> against <about:blank> 
 PASS Origin parsing: <http://example.com/foo/.> against <about:blank> 
@@ -144,8 +145,8 @@
 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> 
-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> 
+FAIL Origin parsing: <gopher://foo:70/> against <about:blank> assert_equals: origin expected "null" but got "gopher://foo:70"
+FAIL Origin parsing: <gopher://foo:443/> against <about:blank> assert_equals: origin expected "null" but got "gopher://foo:443"
 PASS Origin parsing: <ws://foo:80/> against <about:blank> 
 PASS Origin parsing: <ws://foo:81/> against <about:blank> 
 PASS Origin parsing: <ws://foo:443/> against <about:blank> 
@@ -159,7 +160,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://"
-FAIL Origin parsing: <gopher:/example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Origin parsing: <gopher:/example.com/> against <about:blank> assert_equals: origin expected "null" 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 +171,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://"
-FAIL Origin parsing: <gopher:example.com/> against <about:blank> assert_equals: origin expected "gopher://example.com" but got "gopher://"
+FAIL Origin parsing: <gopher:example.com/> against <about:blank> assert_equals: origin expected "null" 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> 
@@ -227,6 +228,8 @@
 PASS Origin parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> 
 PASS Origin parsing: <https://@@@example> against <http://doesnotmatter/> 
 PASS Origin parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> 
+PASS Origin parsing: <http://host/?'> against <about:blank> 
+FAIL Origin parsing: <notspecial://host/?'> against <about:blank> assert_equals: origin expected "null" but got "notspecial://host"
 PASS Origin parsing: </some/path> against <http://[email protected]/smth> 
 PASS Origin parsing: <> against <http://user:[email protected]:21/smth> 
 PASS Origin parsing: </some/path> against <http://user:[email protected]:21/smth> 
@@ -252,12 +255,14 @@
 PASS Origin parsing: <_javascript_:/../> against <about:blank> 
 FAIL Origin parsing: <mailto:/../> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
 FAIL Origin parsing: <sc://ñ.test/> against <about:blank> assert_equals: origin expected "null" but got "sc://%c3%b1.test"
-FAIL Origin parsing: <sc://!"$&'()*+,-.;<=>^_`{|}~/> against <about:blank> Type error
 FAIL Origin parsing: <x> against <sc://ñ> assert_equals: origin expected "null" but got "sc://%c3%b1"
 FAIL Origin parsing: <sc:\../> against <about:blank> assert_equals: origin expected "null" but got "sc://"
 FAIL Origin parsing: <sc::[email protected]> against <about:blank> assert_equals: origin expected "null" but got "sc://"
 FAIL Origin parsing: <wow:%NBD> against <about:blank> assert_equals: origin expected "null" but got "wow://"
 FAIL Origin parsing: <wow:%1G> against <about:blank> assert_equals: origin expected "null" but got "wow://"
+FAIL Origin parsing: <wow:\x{FFFF}> against <about:blank> assert_equals: origin expected "null" but got "wow://"
+PASS Origin parsing: <http://!"$&'()*+,-.;=_`{|}~/> against <about:blank> 
+FAIL Origin parsing: <sc://!"$&'()*+,-.;=_`{|}~/> against <about:blank> assert_equals: origin expected "null" but got "sc://%1f!\"$&'()*+,-.;=_`{|}~"
 PASS Origin parsing: <ftp://%e2%98%83> against <about:blank> 
 PASS Origin parsing: <https://%e2%98%83> against <about:blank> 
 PASS Origin parsing: <http://127.0.0.1:10100/relative_import.html> against <about:blank> 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/urltestdata.json (261763 => 261764)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/urltestdata.json	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/urltestdata.json	2020-05-15 21:55:30 UTC (rev 261764)
@@ -1076,15 +1076,15 @@
   {
     "input": "gopher:/example.com/",
     "base": "http://example.org/foo/bar",
-    "href": "gopher://example.com/",
-    "origin": "gopher://example.com",
+    "href": "gopher:/example.com/",
+    "origin": "null",
     "protocol": "gopher:",
     "username": "",
     "password": "",
-    "host": "example.com",
-    "hostname": "example.com",
+    "host": "",
+    "hostname": "",
     "port": "",
-    "pathname": "/",
+    "pathname": "/example.com/",
     "search": "",
     "hash": ""
   },
@@ -1241,15 +1241,15 @@
   {
     "input": "gopher:example.com/",
     "base": "http://example.org/foo/bar",
-    "href": "gopher://example.com/",
-    "origin": "gopher://example.com",
+    "href": "gopher:example.com/",
+    "origin": "null",
     "protocol": "gopher:",
     "username": "",
     "password": "",
-    "host": "example.com",
-    "hostname": "example.com",
+    "host": "",
+    "hostname": "",
     "port": "",
-    "pathname": "/",
+    "pathname": "example.com/",
     "search": "",
     "hash": ""
   },
@@ -1433,6 +1433,22 @@
     "search": "",
     "hash": ""
   },
+  "# Based on https://felixfbecker.github.io/whatwg-url-custom-host-repro/",
+  {
+    "input": "ssh://example.com/foo/bar.git",
+    "base": "http://example.org/",
+    "href": "ssh://example.com/foo/bar.git",
+    "origin": "null",
+    "protocol": "ssh:",
+    "username": "",
+    "password": "",
+    "host": "example.com",
+    "hostname": "example.com",
+    "port": "",
+    "pathname": "/foo/bar.git",
+    "search": "",
+    "hash": ""
+  },
   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
   {
     "input": "file:c:\\foo\\bar.html",
@@ -2495,14 +2511,14 @@
   {
     "input": "gopher://foo:70/",
     "base": "about:blank",
-    "href": "gopher://foo/",
-    "origin": "gopher://foo",
+    "href": "gopher://foo:70/",
+    "origin": "null",
     "protocol": "gopher:",
     "username": "",
     "password": "",
-    "host": "foo",
+    "host": "foo:70",
     "hostname": "foo",
-    "port": "",
+    "port": "70",
     "pathname": "/",
     "search": "",
     "hash": ""
@@ -2511,7 +2527,7 @@
     "input": "gopher://foo:443/",
     "base": "about:blank",
     "href": "gopher://foo:443/",
-    "origin": "gopher://foo:443",
+    "origin": "null",
     "protocol": "gopher:",
     "username": "",
     "password": "",
@@ -2734,15 +2750,15 @@
   {
     "input": "gopher:/example.com/",
     "base": "about:blank",
-    "href": "gopher://example.com/",
-    "origin": "gopher://example.com",
+    "href": "gopher:/example.com/",
+    "origin": "null",
     "protocol": "gopher:",
     "username": "",
     "password": "",
-    "host": "example.com",
-    "hostname": "example.com",
+    "host": "",
+    "hostname": "",
     "port": "",
-    "pathname": "/",
+    "pathname": "/example.com/",
     "search": "",
     "hash": ""
   },
@@ -2899,15 +2915,15 @@
   {
     "input": "gopher:example.com/",
     "base": "about:blank",
-    "href": "gopher://example.com/",
-    "origin": "gopher://example.com",
+    "href": "gopher:example.com/",
+    "origin": "null",
     "protocol": "gopher:",
     "username": "",
     "password": "",
-    "host": "example.com",
-    "hostname": "example.com",
+    "host": "",
+    "hostname": "",
     "port": "",
-    "pathname": "/",
+    "pathname": "example.com/",
     "search": "",
     "hash": ""
   },
@@ -4015,6 +4031,37 @@
     "search": "?`{}",
     "hash": ""
   },
+  "byte is ' and url is special",
+  {
+    "input": "http://host/?'",
+    "base": "about:blank",
+    "href": "http://host/?%27",
+    "origin": "http://host",
+    "protocol": "http:",
+    "username": "",
+    "password": "",
+    "host": "host",
+    "hostname": "host",
+    "port": "",
+    "pathname": "/",
+    "search": "?%27",
+    "hash": ""
+  },
+  {
+    "input": "notspecial://host/?'",
+    "base": "about:blank",
+    "href": "notspecial://host/?'",
+    "origin": "null",
+    "protocol": "notspecial:",
+    "username": "",
+    "password": "",
+    "host": "host",
+    "hostname": "host",
+    "port": "",
+    "pathname": "/",
+    "search": "?'",
+    "hash": ""
+  },
   "# Credentials in base",
   {
     "input": "/some/path",
@@ -4435,21 +4482,6 @@
     "hash": ""
   },
   {
-    "input": "sc://\u001F!\"$&'()*+,-.;<=>^_`{|}~/",
-    "base": "about:blank",
-    "href": "sc://%1F!\"$&'()*+,-.;<=>^_`{|}~/",
-    "origin": "null",
-    "protocol": "sc:",
-    "username": "",
-    "password": "",
-    "host": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
-    "hostname": "%1F!\"$&'()*+,-.;<=>^_`{|}~",
-    "port": "",
-    "pathname": "/",
-    "search": "",
-    "hash": ""
-  },
-  {
     "input": "sc://\u0000/",
     "base": "about:blank",
     "failure": true
@@ -4586,6 +4618,84 @@
     "search": "",
     "hash": ""
   },
+  "# unknown scheme with non-URL characters in the path",
+  {
+    "input": "wow:\uFFFF",
+    "base": "about:blank",
+    "href": "wow:%EF%BF%BF",
+    "origin": "null",
+    "protocol": "wow:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "%EF%BF%BF",
+    "search": "",
+    "hash": ""
+  },
+  "Forbidden host code points",
+  {
+    "input": "http://a<b",
+    "base": "about:blank",
+    "failure": true
+  },
+  {
+    "input": "http://a>b",
+    "base": "about:blank",
+    "failure": true
+  },
+  {
+    "input": "http://a^b",
+    "base": "about:blank",
+    "failure": true
+  },
+  {
+    "input": "non-special://a<b",
+    "base": "about:blank",
+    "failure": true
+  },
+  {
+    "input": "non-special://a>b",
+    "base": "about:blank",
+    "failure": true
+  },
+  {
+    "input": "non-special://a^b",
+    "base": "about:blank",
+    "failure": true
+  },
+  "Allowed host code points",
+  {
+    "input": "http://\u001F!\"$&'()*+,-.;=_`{|}~/",
+    "base": "about:blank",
+    "href": "http://\u001F!\"$&'()*+,-.;=_`{|}~/",
+    "origin": "http://\u001F!\"$&'()*+,-.;=_`{|}~",
+    "protocol": "http:",
+    "username": "",
+    "password": "",
+    "host": "\u001F!\"$&'()*+,-.;=_`{|}~",
+    "hostname": "\u001F!\"$&'()*+,-.;=_`{|}~",
+    "port": "",
+    "pathname": "/",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "sc://\u001F!\"$&'()*+,-.;=_`{|}~/",
+    "base": "about:blank",
+    "href": "sc://%1F!\"$&'()*+,-.;=_`{|}~/",
+    "origin": "null",
+    "protocol": "sc:",
+    "username": "",
+    "password": "",
+    "host": "%1F!\"$&'()*+,-.;=_`{|}~",
+    "hostname": "%1F!\"$&'()*+,-.;=_`{|}~",
+    "port": "",
+    "pathname": "/",
+    "search": "",
+    "hash": ""
+  },
   "# Hosts and percent-encoding",
   {
     "input": "ftp://example.com%80/",
@@ -5800,6 +5910,130 @@
     "search": "",
     "hash": "#frag"
   },
+  "# file: drive letter cases from https://crbug.com/1078698",
+  {
+    "input": "file:///Y:",
+    "base": "about:blank",
+    "href": "file:///Y:",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/Y:",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "file:///Y:/",
+    "base": "about:blank",
+    "href": "file:///Y:/",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/Y:/",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "file:///./Y",
+    "base": "about:blank",
+    "href": "file:///Y",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/Y",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "file:///./Y:",
+    "base": "about:blank",
+    "href": "file:///Y:",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/Y:",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "\\\\\\.\\Y:",
+    "base": "about:blank",
+    "failure": true
+  },
+  "# file: drive letter cases from https://crbug.com/1078698 but lowercased",
+  {
+    "input": "file:///y:",
+    "base": "about:blank",
+    "href": "file:///y:",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/y:",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "file:///y:/",
+    "base": "about:blank",
+    "href": "file:///y:/",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/y:/",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "file:///./y",
+    "base": "about:blank",
+    "href": "file:///y",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/y",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "file:///./y:",
+    "base": "about:blank",
+    "href": "file:///y:",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/y:",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "\\\\\\.\\y:",
+    "base": "about:blank",
+    "failure": true
+  },
   "# IPv6 tests",
   {
     "input": "http://[1:0::]",
@@ -6521,22 +6755,23 @@
     "search": "?a",
     "hash": "#%GH"
   },
-  "Bad bases",
+  "URLs that require a non-about:blank base. (Also serve as invalid base tests.)",
   {
-    "input": "test-a.html",
-    "base": "a",
+    "input": "a",
+    "base": "about:blank",
     "failure": true
   },
   {
-    "input": "test-a-slash.html",
-    "base": "a/",
+    "input": "a/",
+    "base": "about:blank",
     "failure": true
   },
   {
-    "input": "test-a-slash-slash.html",
-    "base": "a//",
+    "input": "a//",
+    "base": "about:blank",
     "failure": true
   },
+  "Bases that don't fail to parse but fail to be bases",
   {
     "input": "test-a-colon.html",
     "base": "a:",
@@ -6543,6 +6778,12 @@
     "failure": true
   },
   {
+    "input": "test-a-colon-b.html",
+    "base": "a:b",
+    "failure": true
+  },
+  "Other base URL tests, that must succeed",
+  {
     "input": "test-a-colon-slash.html",
     "base": "a:/",
     "href": "a:/test-a-colon-slash.html",
@@ -6571,11 +6812,6 @@
     "hash": ""
   },
   {
-    "input": "test-a-colon-b.html",
-    "base": "a:b",
-    "failure": true
-  },
-  {
     "input": "test-a-colon-slash-b.html",
     "base": "a:/b",
     "href": "a:/test-a-colon-slash-b.html",
@@ -6607,7 +6843,7 @@
   {
     "input": "http://example.org/test?a#b\u0000c",
     "base": "about:blank",
-    "href": "http://example.org/test?a#bc",
+    "href": "http://example.org/test?a#b%00c",
     "protocol": "http:",
     "username": "",
     "password": "",
@@ -6616,6 +6852,124 @@
     "port": "",
     "pathname": "/test",
     "search": "?a",
-    "hash": "#bc"
+    "hash": "#b%00c"
+  },
+  {
+    "input": "non-spec://example.org/test?a#b\u0000c",
+    "base": "about:blank",
+    "href": "non-spec://example.org/test?a#b%00c",
+    "protocol": "non-spec:",
+    "username": "",
+    "password": "",
+    "host": "example.org",
+    "hostname": "example.org",
+    "port": "",
+    "pathname": "/test",
+    "search": "?a",
+    "hash": "#b%00c"
+  },
+  {
+    "input": "non-spec:/test?a#b\u0000c",
+    "base": "about:blank",
+    "href": "non-spec:/test?a#b%00c",
+    "protocol": "non-spec:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/test",
+    "search": "?a",
+    "hash": "#b%00c"
+  },
+  "First scheme char - not allowed: https://github.com/whatwg/url/issues/464",
+  {
+    "input": "10.0.0.7:8080/foo.html",
+    "base": "file:///some/dir/bar.html",
+    "href": "file:///some/dir/10.0.0.7:8080/foo.html",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/some/dir/10.0.0.7:8080/foo.html",
+    "search": "",
+    "hash": ""
+  },
+  "Subsequent scheme chars - not allowed",
+  {
+    "input": "a!@$*=/foo.html",
+    "base": "file:///some/dir/bar.html",
+    "href": "file:///some/dir/a!@$*=/foo.html",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "/some/dir/a!@$*=/foo.html",
+    "search": "",
+    "hash": ""
+  },
+  "First and subsequent scheme chars - allowed",
+  {
+    "input": "a1234567890-+.:foo/bar",
+    "base": "http://example.com/dir/file",
+    "href": "a1234567890-+.:foo/bar",
+    "protocol": "a1234567890-+.:",
+    "username": "",
+    "password": "",
+    "host": "",
+    "hostname": "",
+    "port": "",
+    "pathname": "foo/bar",
+    "search": "",
+    "hash": ""
+  },
+  "IDNA ignored code points in file URLs hosts",
+  {
+    "input": "file://a\u00ADb/p",
+    "base": "about:blank",
+    "href": "file://ab/p",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "ab",
+    "hostname": "ab",
+    "port": "",
+    "pathname": "/p",
+    "search": "",
+    "hash": ""
+  },
+  {
+    "input": "file://a%C2%ADb/p",
+    "base": "about:blank",
+    "href": "file://ab/p",
+    "protocol": "file:",
+    "username": "",
+    "password": "",
+    "host": "ab",
+    "hostname": "ab",
+    "port": "",
+    "pathname": "/p",
+    "search": "",
+    "hash": ""
+  },
+  "Empty host after the domain to ASCII",
+  {
+    "input": "file://\u00ad/p",
+    "base": "about:blank",
+    "failure": true
+  },
+  {
+    "input": "file://%C2%AD/p",
+    "base": "about:blank",
+    "failure": true
+  },
+  {
+    "input": "file://xn--/p",
+    "base": "about:blank",
+    "failure": true
   }
-]
+]
\ No newline at end of file

Modified: trunk/Source/WTF/ChangeLog (261763 => 261764)


--- trunk/Source/WTF/ChangeLog	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/Source/WTF/ChangeLog	2020-05-15 21:55:30 UTC (rev 261764)
@@ -1,3 +1,17 @@
+2020-05-15  Alex Christensen  <[email protected]>
+
+        Make host parser fail on ^
+        https://bugs.webkit.org/show_bug.cgi?id=211901
+
+        Reviewed by Geoffrey Garen.
+
+        This matches the behavior of Chrome and Firefox, and now the specification!
+        I updated the URL wpt data, and this introduces new PASSes.
+
+        * wtf/URLParser.cpp:
+        (WTF::isC0Control):
+        (WTF::isForbiddenHostCodePoint):
+
 2020-05-14  Wenson Hsieh  <[email protected]>
 
         [macOS] Update the placeholder icon image for attachment elements with progress="0"

Modified: trunk/Source/WTF/wtf/URLParser.cpp (261763 => 261764)


--- trunk/Source/WTF/wtf/URLParser.cpp	2020-05-15 21:40:16 UTC (rev 261763)
+++ trunk/Source/WTF/wtf/URLParser.cpp	2020-05-15 21:55:30 UTC (rev 261764)
@@ -238,7 +238,7 @@
     UserInfo | ForbiddenHost, // '['
     UserInfo | SlashQuestionOrHash | ForbiddenHost, // '\\'
     UserInfo | ForbiddenHost, // ']'
-    UserInfo, // '^'
+    UserInfo | ForbiddenHost, // '^'
     0, // '_'
     UserInfo | Default, // '`'
     ValidScheme, // 'a'
@@ -411,7 +411,7 @@
 template<typename CharacterType> ALWAYS_INLINE static bool isPercentOrNonASCII(CharacterType character) { return !isASCII(character) || character == '%'; }
 template<typename CharacterType> ALWAYS_INLINE static bool isSlashQuestionOrHash(CharacterType character) { return character <= '\\' && characterClassTable[character] & SlashQuestionOrHash; }
 template<typename CharacterType> ALWAYS_INLINE static bool isValidSchemeCharacter(CharacterType character) { return character <= 'z' && characterClassTable[character] & ValidScheme; }
-template<typename CharacterType> ALWAYS_INLINE static bool isForbiddenHostCodePoint(CharacterType character) { return character <= ']' && characterClassTable[character] & ForbiddenHost; }
+template<typename CharacterType> ALWAYS_INLINE static bool isForbiddenHostCodePoint(CharacterType character) { return character <= '^' && characterClassTable[character] & ForbiddenHost; }
 ALWAYS_INLINE static bool shouldPercentEncodeQueryByte(uint8_t byte, const bool& urlIsSpecial)
 {
     if (characterClassTable[byte] & QueryPercent)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to