Non-special URLs should have an opaque origin
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2016 20:01:08 +0000 (20:01 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 20 Sep 2016 20:01:08 +0000 (20:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=162254

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

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

Source/WebCore:

Covered by newly passing web platform tests.

* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
According to https://url.spec.whatwg.org/#origin all URLs with non-special protocols
should have a unique SecurityOrigin whose serialization is "null".

LayoutTests:

* http/tests/security/postMessage/invalid-origin-throws-exception-expected.txt:
* http/tests/security/postMessage/invalid-origin-throws-exception.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206165 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/security/postMessage/invalid-origin-throws-exception-expected.txt
LayoutTests/http/tests/security/postMessage/invalid-origin-throws-exception.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt
LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt
LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/SecurityOrigin.cpp

index 1ea47c793231a19f8bbf705f7913f4e30890b210..aaa4a75aec195c00bca29e18249f943ac77b45fa 100644 (file)
@@ -1,3 +1,13 @@
+2016-09-20  Alex Christensen  <achristensen@webkit.org>
+
+        Non-special URLs should have an opaque origin
+        https://bugs.webkit.org/show_bug.cgi?id=162254
+
+        Reviewed by Sam Weinig.
+
+        * http/tests/security/postMessage/invalid-origin-throws-exception-expected.txt:
+        * http/tests/security/postMessage/invalid-origin-throws-exception.html:
+
 2016-09-20  Javier Fernandez  <jfernandez@igalia.com>
 
         [css-grid] The 'grid' shorthand has a new syntax.
index b66caaaa1b280fd2e4c646935f69f804897ecf81..f34b329518528e25e511ba5abc1e028bbb5d59cd 100644 (file)
@@ -1,12 +1,10 @@
-CONSOLE MESSAGE: Unable to post message to asdf://. Recipient has origin http://localhost:8000.
-
 window.location.href = http://127.0.0.1:8000/security/postMessage/invalid-origin-throws-exception.html
 waiting...
 Encountered exception SyntaxError (DOM Exception 12): The string did not match the expected pattern. while posting message to ''.
 Encountered exception SyntaxError (DOM Exception 12): The string did not match the expected pattern. while posting message to 'asdf'.
 Encountered exception SyntaxError (DOM Exception 12): The string did not match the expected pattern. while posting message to '/tmp/foo'.
 Encountered exception SyntaxError (DOM Exception 12): The string did not match the expected pattern. while posting message to '//localhost'.
-Posted message to 'asdf:' without any exceptions.
+Encountered exception SyntaxError (DOM Exception 12): The string did not match the expected pattern. while posting message to 'asdf:'.
 Encountered exception SyntaxError (DOM Exception 12): The string did not match the expected pattern. while posting message to 'http:'.
 Received message: data="Received message: data="done" origin="http://127.0.0.1:8000"" origin="http://localhost:8000"
 
index b8094849154583b0f42f4f604e3cb3ba5b833cf8..be4e4c96ff225a69672ea1bb0de8f9fd6a7aef0e 100644 (file)
@@ -29,7 +29,7 @@ function test() {
     tryPostMessage("/tmp/foo");
     tryPostMessage("//localhost");
 
-    // URLs without an origin should fail without generating any errors.
+    // URLs without an origin should fail with a syntax error.
     tryPostMessage("asdf:");
     tryPostMessage("http:");
     
index c8df5f2036e37f140a935d85b72bccc1feed68cb..78037470cdafefd96a9cac6ec359a40c7e54e2f4 100644 (file)
@@ -1,3 +1,14 @@
+2016-09-20  Alex Christensen  <achristensen@webkit.org>
+
+        Non-special URLs should have an opaque origin
+        https://bugs.webkit.org/show_bug.cgi?id=162254
+
+        Reviewed by Sam Weinig.
+
+        * web-platform-tests/url/a-element-expected.txt:
+        * web-platform-tests/url/a-element-xhtml-expected.txt:
+        * web-platform-tests/url/url-constructor-expected.txt:
+
 2016-09-20  Jer Noble  <jer.noble@apple.com>
 
         [media-source] Support MediaSource.setLiveSeekableRanges()
index e006a2faafaa4e06b02a3ebd208a76c4eac22442..01603be2bbd71769068c4663074ea957b008e4cd 100644 (file)
@@ -7,7 +7,7 @@ PASS Parsing: <http:foo.com> against <http://example.org/foo/bar>
 PASS Parsing: <           :foo.com   
 > against <http://example.org/foo/bar> 
 PASS Parsing: < foo.com  > against <http://example.org/foo/bar> 
-FAIL Parsing: <a:       foo.com> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "a://"
+PASS Parsing: <a:       foo.com> against <http://example.org/foo/bar> 
 PASS Parsing: <http://f:21/ b ? d # e > against <http://example.org/foo/bar> 
 PASS Parsing: <http://f:/c> against <http://example.org/foo/bar> 
 FAIL Parsing: <http://f:0/c> against <http://example.org/foo/bar> assert_equals: origin expected "http://f:0" but got "http://f"
@@ -48,12 +48,12 @@ PASS Parsing: <http://foo.com:b@d/> against <http://example.org/foo/bar>
 PASS Parsing: <http://foo.com/\@> against <http://example.org/foo/bar> 
 PASS Parsing: <http:\\foo.com\> against <http://example.org/foo/bar> 
 PASS Parsing: <http:\\a\b:c\d@foo.com\> against <http://example.org/foo/bar> 
-FAIL Parsing: <foo:/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo:/bar.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo://///////> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo:////://///> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <c:/foo> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "c://"
+PASS Parsing: <foo:/> against <http://example.org/foo/bar> 
+PASS Parsing: <foo:/bar.com/> against <http://example.org/foo/bar> 
+FAIL Parsing: <foo://///////> against <http://example.org/foo/bar> assert_equals: pathname expected "///////" but got "/////////"
+FAIL Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar> assert_equals: pathname expected "///////bar.com/" but got "/////////bar.com/"
+FAIL Parsing: <foo:////://///> against <http://example.org/foo/bar> assert_equals: pathname expected "//://///" but got "////://///"
+PASS Parsing: <c:/foo> against <http://example.org/foo/bar> 
 PASS Parsing: <//foo/bar> against <http://example.org/foo/bar> 
 PASS Parsing: <http://foo/path;a??e#f#g> against <http://example.org/foo/bar> 
 PASS Parsing: <http://foo/abcd?efgh?ijkl> against <http://example.org/foo/bar> 
@@ -69,33 +69,33 @@ PASS Parsing: <http://[2001::1]:80> against <http://example.org/foo/bar>
 FAIL Parsing: <http:/example.com/> against <http://example.org/foo/bar> assert_equals: href expected "http://example.org/example.com/" but got "http://example.com/"
 PASS Parsing: <ftp:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <https:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
+PASS Parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <file:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <ftps:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <ftps:/example.com/> against <http://example.org/foo/bar> 
 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> 
 PASS Parsing: <javascript:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <mailto:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <http:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <ftp:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <https:example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <madeupscheme:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
-FAIL Parsing: <ftps:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
+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> 
 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> 
 PASS Parsing: <javascript:example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <mailto:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: </a/b/c> against <http://example.org/foo/bar> 
 PASS Parsing: </a/ /c> against <http://example.org/foo/bar> 
 PASS Parsing: </a%2fc> against <http://example.org/foo/bar> 
 PASS Parsing: </a/%2f/c> against <http://example.org/foo/bar> 
 FAIL Parsing: <#β> against <http://example.org/foo/bar> assert_equals: href expected "http://example.org/foo/bar#β" but got "http://example.org/foo/bar#%CE%B2"
 PASS Parsing: <data:text/html,test#test> against <http://example.org/foo/bar> 
-FAIL Parsing: <tel:1234567890> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "tel://"
+PASS Parsing: <tel:1234567890> against <http://example.org/foo/bar> 
 FAIL Parsing: <file:c:\foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:/foo/bar.html" but got "file:///tmp/mock/c:/foo/bar.html"
 FAIL Parsing: <  File:c|////foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:////foo/bar.html" but got "file:///tmp/mock/c|////foo/bar.html"
 FAIL Parsing: <C|/foo/bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file:///tmp/mock/C|/foo/bar"
@@ -164,7 +164,7 @@ PASS Parsing: <http://%25DOMAIN:foobar@foodomain.com/> against <about:blank>
 PASS Parsing: <http:\\www.google.com\foo> against <about:blank> 
 PASS Parsing: <http://foo:80/> against <about:blank> 
 PASS Parsing: <http://foo:81/> against <about:blank> 
-FAIL Parsing: <httpa://foo:80/> against <about:blank> assert_equals: origin expected "null" but got "httpa://foo:80"
+PASS Parsing: <httpa://foo:80/> against <about:blank> 
 PASS Parsing: <http://foo:-80/> against <about:blank> 
 PASS Parsing: <https://foo:443/> against <about:blank> 
 PASS Parsing: <https://foo:80/> against <about:blank> 
@@ -183,26 +183,26 @@ PASS Parsing: <wss://foo:815/> against <about:blank>
 PASS Parsing: <http:/example.com/> against <about:blank> 
 PASS Parsing: <ftp:/example.com/> against <about:blank> 
 PASS Parsing: <https:/example.com/> against <about:blank> 
-FAIL Parsing: <madeupscheme:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
+PASS Parsing: <madeupscheme:/example.com/> against <about:blank> 
 PASS Parsing: <file:/example.com/> against <about:blank> 
-FAIL Parsing: <ftps:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <ftps:/example.com/> against <about:blank> 
 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> 
 PASS Parsing: <javascript:/example.com/> against <about:blank> 
-FAIL Parsing: <mailto:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:/example.com/> against <about:blank> 
 PASS Parsing: <http:example.com/> against <about:blank> 
 PASS Parsing: <ftp:example.com/> against <about:blank> 
 PASS Parsing: <https:example.com/> against <about:blank> 
-FAIL Parsing: <madeupscheme:example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
-FAIL Parsing: <ftps:example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <madeupscheme:example.com/> against <about:blank> 
+PASS Parsing: <ftps:example.com/> against <about:blank> 
 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> 
 PASS Parsing: <javascript:example.com/> against <about:blank> 
-FAIL Parsing: <mailto:example.com/> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:example.com/> against <about:blank> 
 PASS Parsing: <http:@www.example.com> against <about:blank> 
 PASS Parsing: <http:/@www.example.com> against <about:blank> 
 PASS Parsing: <http://@www.example.com> against <about:blank> 
@@ -273,11 +273,11 @@ PASS Parsing: <http://192.168.0.1 hello> against <http://other.com/>
 FAIL Parsing: <http://0Xc0.0250.01> against <http://other.com/> assert_equals: href expected "http://192.168.0.1/" but got "http://0xc0.0250.01/"
 PASS Parsing: <http://[google.com]> against <http://other.com/> 
 FAIL Parsing: <http://foo:💩@example.com/bar> against <http://other.com/> assert_equals: href expected "http://foo:%F0%9F%92%A9@example.com/bar" but got "http://foo:💩@example.com/bar"
-FAIL Parsing: <#> against <test:test> assert_equals: origin expected "null" but got "test://"
-FAIL Parsing: <#x> against <mailto:x@x.com> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <#> against <test:test> 
+PASS Parsing: <#x> against <mailto:x@x.com> 
 PASS Parsing: <#x> against <data:,> 
 PASS Parsing: <#x> against <about:blank> 
-FAIL Parsing: <#> against <test:test?test> assert_equals: origin expected "null" but got "test://"
+PASS Parsing: <#> against <test:test?test> 
 FAIL Parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> assert_equals: href expected "https://%40test%40test@example:800/" but got "https://@test@test@example:800/"
 FAIL Parsing: <https://@@@example> against <http://doesnotmatter/> assert_equals: href expected "https://%40%40@example/" but got "https://@@@example"
 FAIL Parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> assert_equals: href expected "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}" but got "http://`{}:`{}@h/`{}?`{}"
@@ -286,36 +286,36 @@ PASS Parsing: <> against <http://user:pass@example.org:21/smth>
 PASS Parsing: </some/path> against <http://user:pass@example.org:21/smth> 
 PASS Parsing: <i> against <sc:sd> 
 PASS Parsing: <i> against <sc:sd/sd> 
-FAIL Parsing: <i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <i> against <sc:/pa/pa> 
+PASS Parsing: <i> against <sc://ho/pa> 
+FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/i" but got "///pa/i"
 PASS Parsing: <../i> against <sc:sd> 
 PASS Parsing: <../i> against <sc:sd/sd> 
-FAIL Parsing: <../i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <../i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <../i> against <sc:/pa/pa> 
+PASS Parsing: <../i> against <sc://ho/pa> 
+FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: pathname expected "/i" but got "///i"
 PASS Parsing: </i> against <sc:sd> 
 PASS Parsing: </i> against <sc:sd/sd> 
-FAIL Parsing: </i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: </i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
+PASS Parsing: </i> against <sc:/pa/pa> 
+PASS Parsing: </i> against <sc://ho/pa> 
 FAIL Parsing: </i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:/i"
 PASS Parsing: <?i> against <sc:sd> 
 PASS Parsing: <?i> against <sc:sd/sd> 
-FAIL Parsing: <?i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <?i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:sd> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:sd/sd> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <?i> against <sc:/pa/pa> 
+PASS Parsing: <?i> against <sc://ho/pa> 
+FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
+PASS Parsing: <#i> against <sc:sd> 
+PASS Parsing: <#i> against <sc:sd/sd> 
+PASS Parsing: <#i> against <sc:/pa/pa> 
+PASS Parsing: <#i> against <sc://ho/pa> 
+FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
 PASS Parsing: <about:/../> against <about:blank> 
 PASS Parsing: <data:/../> against <about:blank> 
 PASS Parsing: <javascript:/../> against <about:blank> 
-FAIL Parsing: <mailto:/../> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
-FAIL Parsing: <sc://ñ.test/> against <about:blank> assert_equals: origin expected "null" but got "sc://xn--ida.test"
+PASS Parsing: <mailto:/../> against <about:blank> 
+PASS Parsing: <sc://ñ.test/> against <about:blank> 
 FAIL Parsing: <sc:\../> against <about:blank> assert_equals: href expected "sc:\\../" but got "sc:/"
-FAIL Parsing: <sc::a@example.net> against <about:blank> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <sc::a@example.net> against <about:blank> 
 PASS Parsing: <http://127.0.0.1:10100/relative_import.html> against <about:blank> 
 PASS Parsing: <http://facebook.com/?foo=%7B%22abc%22> against <about:blank> 
 PASS Parsing: <https://localhost:3000/jqueryui@1.2.3> against <about:blank> 
@@ -336,5 +336,5 @@ PASS Parsing: <?a=b&c=d> against <http://example.org/foo/bar>
 PASS Parsing: <??a=b&c=d> against <http://example.org/foo/bar> 
 PASS Parsing: <http:> against <http://example.org/foo/bar> 
 FAIL Parsing: <http:> against <https://example.org/foo/bar> assert_unreached: Expected URL to fail parsing Reached unreachable code
-FAIL Parsing: <sc:> against <https://example.org/foo/bar> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <sc:> against <https://example.org/foo/bar> 
 
index e006a2faafaa4e06b02a3ebd208a76c4eac22442..01603be2bbd71769068c4663074ea957b008e4cd 100644 (file)
@@ -7,7 +7,7 @@ PASS Parsing: <http:foo.com> against <http://example.org/foo/bar>
 PASS Parsing: <           :foo.com   
 > against <http://example.org/foo/bar> 
 PASS Parsing: < foo.com  > against <http://example.org/foo/bar> 
-FAIL Parsing: <a:       foo.com> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "a://"
+PASS Parsing: <a:       foo.com> against <http://example.org/foo/bar> 
 PASS Parsing: <http://f:21/ b ? d # e > against <http://example.org/foo/bar> 
 PASS Parsing: <http://f:/c> against <http://example.org/foo/bar> 
 FAIL Parsing: <http://f:0/c> against <http://example.org/foo/bar> assert_equals: origin expected "http://f:0" but got "http://f"
@@ -48,12 +48,12 @@ PASS Parsing: <http://foo.com:b@d/> against <http://example.org/foo/bar>
 PASS Parsing: <http://foo.com/\@> against <http://example.org/foo/bar> 
 PASS Parsing: <http:\\foo.com\> against <http://example.org/foo/bar> 
 PASS Parsing: <http:\\a\b:c\d@foo.com\> against <http://example.org/foo/bar> 
-FAIL Parsing: <foo:/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo:/bar.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo://///////> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo:////://///> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <c:/foo> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "c://"
+PASS Parsing: <foo:/> against <http://example.org/foo/bar> 
+PASS Parsing: <foo:/bar.com/> against <http://example.org/foo/bar> 
+FAIL Parsing: <foo://///////> against <http://example.org/foo/bar> assert_equals: pathname expected "///////" but got "/////////"
+FAIL Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar> assert_equals: pathname expected "///////bar.com/" but got "/////////bar.com/"
+FAIL Parsing: <foo:////://///> against <http://example.org/foo/bar> assert_equals: pathname expected "//://///" but got "////://///"
+PASS Parsing: <c:/foo> against <http://example.org/foo/bar> 
 PASS Parsing: <//foo/bar> against <http://example.org/foo/bar> 
 PASS Parsing: <http://foo/path;a??e#f#g> against <http://example.org/foo/bar> 
 PASS Parsing: <http://foo/abcd?efgh?ijkl> against <http://example.org/foo/bar> 
@@ -69,33 +69,33 @@ PASS Parsing: <http://[2001::1]:80> against <http://example.org/foo/bar>
 FAIL Parsing: <http:/example.com/> against <http://example.org/foo/bar> assert_equals: href expected "http://example.org/example.com/" but got "http://example.com/"
 PASS Parsing: <ftp:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <https:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
+PASS Parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <file:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <ftps:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <ftps:/example.com/> against <http://example.org/foo/bar> 
 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> 
 PASS Parsing: <javascript:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <mailto:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <http:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <ftp:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <https:example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <madeupscheme:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
-FAIL Parsing: <ftps:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
+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> 
 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> 
 PASS Parsing: <javascript:example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <mailto:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: </a/b/c> against <http://example.org/foo/bar> 
 PASS Parsing: </a/ /c> against <http://example.org/foo/bar> 
 PASS Parsing: </a%2fc> against <http://example.org/foo/bar> 
 PASS Parsing: </a/%2f/c> against <http://example.org/foo/bar> 
 FAIL Parsing: <#β> against <http://example.org/foo/bar> assert_equals: href expected "http://example.org/foo/bar#β" but got "http://example.org/foo/bar#%CE%B2"
 PASS Parsing: <data:text/html,test#test> against <http://example.org/foo/bar> 
-FAIL Parsing: <tel:1234567890> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "tel://"
+PASS Parsing: <tel:1234567890> against <http://example.org/foo/bar> 
 FAIL Parsing: <file:c:\foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:/foo/bar.html" but got "file:///tmp/mock/c:/foo/bar.html"
 FAIL Parsing: <  File:c|////foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:////foo/bar.html" but got "file:///tmp/mock/c|////foo/bar.html"
 FAIL Parsing: <C|/foo/bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file:///tmp/mock/C|/foo/bar"
@@ -164,7 +164,7 @@ PASS Parsing: <http://%25DOMAIN:foobar@foodomain.com/> against <about:blank>
 PASS Parsing: <http:\\www.google.com\foo> against <about:blank> 
 PASS Parsing: <http://foo:80/> against <about:blank> 
 PASS Parsing: <http://foo:81/> against <about:blank> 
-FAIL Parsing: <httpa://foo:80/> against <about:blank> assert_equals: origin expected "null" but got "httpa://foo:80"
+PASS Parsing: <httpa://foo:80/> against <about:blank> 
 PASS Parsing: <http://foo:-80/> against <about:blank> 
 PASS Parsing: <https://foo:443/> against <about:blank> 
 PASS Parsing: <https://foo:80/> against <about:blank> 
@@ -183,26 +183,26 @@ PASS Parsing: <wss://foo:815/> against <about:blank>
 PASS Parsing: <http:/example.com/> against <about:blank> 
 PASS Parsing: <ftp:/example.com/> against <about:blank> 
 PASS Parsing: <https:/example.com/> against <about:blank> 
-FAIL Parsing: <madeupscheme:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
+PASS Parsing: <madeupscheme:/example.com/> against <about:blank> 
 PASS Parsing: <file:/example.com/> against <about:blank> 
-FAIL Parsing: <ftps:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <ftps:/example.com/> against <about:blank> 
 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> 
 PASS Parsing: <javascript:/example.com/> against <about:blank> 
-FAIL Parsing: <mailto:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:/example.com/> against <about:blank> 
 PASS Parsing: <http:example.com/> against <about:blank> 
 PASS Parsing: <ftp:example.com/> against <about:blank> 
 PASS Parsing: <https:example.com/> against <about:blank> 
-FAIL Parsing: <madeupscheme:example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
-FAIL Parsing: <ftps:example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <madeupscheme:example.com/> against <about:blank> 
+PASS Parsing: <ftps:example.com/> against <about:blank> 
 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> 
 PASS Parsing: <javascript:example.com/> against <about:blank> 
-FAIL Parsing: <mailto:example.com/> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:example.com/> against <about:blank> 
 PASS Parsing: <http:@www.example.com> against <about:blank> 
 PASS Parsing: <http:/@www.example.com> against <about:blank> 
 PASS Parsing: <http://@www.example.com> against <about:blank> 
@@ -273,11 +273,11 @@ PASS Parsing: <http://192.168.0.1 hello> against <http://other.com/>
 FAIL Parsing: <http://0Xc0.0250.01> against <http://other.com/> assert_equals: href expected "http://192.168.0.1/" but got "http://0xc0.0250.01/"
 PASS Parsing: <http://[google.com]> against <http://other.com/> 
 FAIL Parsing: <http://foo:💩@example.com/bar> against <http://other.com/> assert_equals: href expected "http://foo:%F0%9F%92%A9@example.com/bar" but got "http://foo:💩@example.com/bar"
-FAIL Parsing: <#> against <test:test> assert_equals: origin expected "null" but got "test://"
-FAIL Parsing: <#x> against <mailto:x@x.com> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <#> against <test:test> 
+PASS Parsing: <#x> against <mailto:x@x.com> 
 PASS Parsing: <#x> against <data:,> 
 PASS Parsing: <#x> against <about:blank> 
-FAIL Parsing: <#> against <test:test?test> assert_equals: origin expected "null" but got "test://"
+PASS Parsing: <#> against <test:test?test> 
 FAIL Parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> assert_equals: href expected "https://%40test%40test@example:800/" but got "https://@test@test@example:800/"
 FAIL Parsing: <https://@@@example> against <http://doesnotmatter/> assert_equals: href expected "https://%40%40@example/" but got "https://@@@example"
 FAIL Parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> assert_equals: href expected "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}" but got "http://`{}:`{}@h/`{}?`{}"
@@ -286,36 +286,36 @@ PASS Parsing: <> against <http://user:pass@example.org:21/smth>
 PASS Parsing: </some/path> against <http://user:pass@example.org:21/smth> 
 PASS Parsing: <i> against <sc:sd> 
 PASS Parsing: <i> against <sc:sd/sd> 
-FAIL Parsing: <i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <i> against <sc:/pa/pa> 
+PASS Parsing: <i> against <sc://ho/pa> 
+FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/i" but got "///pa/i"
 PASS Parsing: <../i> against <sc:sd> 
 PASS Parsing: <../i> against <sc:sd/sd> 
-FAIL Parsing: <../i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <../i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <../i> against <sc:/pa/pa> 
+PASS Parsing: <../i> against <sc://ho/pa> 
+FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: pathname expected "/i" but got "///i"
 PASS Parsing: </i> against <sc:sd> 
 PASS Parsing: </i> against <sc:sd/sd> 
-FAIL Parsing: </i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: </i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
+PASS Parsing: </i> against <sc:/pa/pa> 
+PASS Parsing: </i> against <sc://ho/pa> 
 FAIL Parsing: </i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:/i"
 PASS Parsing: <?i> against <sc:sd> 
 PASS Parsing: <?i> against <sc:sd/sd> 
-FAIL Parsing: <?i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <?i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:sd> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:sd/sd> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <?i> against <sc:/pa/pa> 
+PASS Parsing: <?i> against <sc://ho/pa> 
+FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
+PASS Parsing: <#i> against <sc:sd> 
+PASS Parsing: <#i> against <sc:sd/sd> 
+PASS Parsing: <#i> against <sc:/pa/pa> 
+PASS Parsing: <#i> against <sc://ho/pa> 
+FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
 PASS Parsing: <about:/../> against <about:blank> 
 PASS Parsing: <data:/../> against <about:blank> 
 PASS Parsing: <javascript:/../> against <about:blank> 
-FAIL Parsing: <mailto:/../> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
-FAIL Parsing: <sc://ñ.test/> against <about:blank> assert_equals: origin expected "null" but got "sc://xn--ida.test"
+PASS Parsing: <mailto:/../> against <about:blank> 
+PASS Parsing: <sc://ñ.test/> against <about:blank> 
 FAIL Parsing: <sc:\../> against <about:blank> assert_equals: href expected "sc:\\../" but got "sc:/"
-FAIL Parsing: <sc::a@example.net> against <about:blank> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <sc::a@example.net> against <about:blank> 
 PASS Parsing: <http://127.0.0.1:10100/relative_import.html> against <about:blank> 
 PASS Parsing: <http://facebook.com/?foo=%7B%22abc%22> against <about:blank> 
 PASS Parsing: <https://localhost:3000/jqueryui@1.2.3> against <about:blank> 
@@ -336,5 +336,5 @@ PASS Parsing: <?a=b&c=d> against <http://example.org/foo/bar>
 PASS Parsing: <??a=b&c=d> against <http://example.org/foo/bar> 
 PASS Parsing: <http:> against <http://example.org/foo/bar> 
 FAIL Parsing: <http:> against <https://example.org/foo/bar> assert_unreached: Expected URL to fail parsing Reached unreachable code
-FAIL Parsing: <sc:> against <https://example.org/foo/bar> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <sc:> against <https://example.org/foo/bar> 
 
index 017dfe8abb4490eecaede8898fa54611d7f88e5b..11c8f0e632a7703691ab385d182ee9dde5987c6d 100644 (file)
@@ -11,7 +11,7 @@ PASS Parsing: <http:foo.com> against <http://example.org/foo/bar>
 PASS Parsing: <           :foo.com   
 > against <http://example.org/foo/bar> 
 PASS Parsing: < foo.com  > against <http://example.org/foo/bar> 
-FAIL Parsing: <a:       foo.com> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "a://"
+PASS Parsing: <a:       foo.com> against <http://example.org/foo/bar> 
 PASS Parsing: <http://f:21/ b ? d # e > against <http://example.org/foo/bar> 
 PASS Parsing: <http://f:/c> against <http://example.org/foo/bar> 
 FAIL Parsing: <http://f:0/c> against <http://example.org/foo/bar> assert_equals: origin expected "http://f:0" but got "http://f"
@@ -53,12 +53,12 @@ PASS Parsing: <http://foo.com:b@d/> against <http://example.org/foo/bar>
 PASS Parsing: <http://foo.com/\@> against <http://example.org/foo/bar> 
 PASS Parsing: <http:\\foo.com\> against <http://example.org/foo/bar> 
 PASS Parsing: <http:\\a\b:c\d@foo.com\> against <http://example.org/foo/bar> 
-FAIL Parsing: <foo:/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo:/bar.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo://///////> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <foo:////://///> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "foo://"
-FAIL Parsing: <c:/foo> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "c://"
+PASS Parsing: <foo:/> against <http://example.org/foo/bar> 
+PASS Parsing: <foo:/bar.com/> against <http://example.org/foo/bar> 
+FAIL Parsing: <foo://///////> against <http://example.org/foo/bar> assert_equals: pathname expected "///////" but got "/////////"
+FAIL Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar> assert_equals: pathname expected "///////bar.com/" but got "/////////bar.com/"
+FAIL Parsing: <foo:////://///> against <http://example.org/foo/bar> assert_equals: pathname expected "//://///" but got "////://///"
+PASS Parsing: <c:/foo> against <http://example.org/foo/bar> 
 PASS Parsing: <//foo/bar> against <http://example.org/foo/bar> 
 PASS Parsing: <http://foo/path;a??e#f#g> against <http://example.org/foo/bar> 
 PASS Parsing: <http://foo/abcd?efgh?ijkl> against <http://example.org/foo/bar> 
@@ -74,33 +74,33 @@ PASS Parsing: <http://[2001::1]:80> against <http://example.org/foo/bar>
 FAIL Parsing: <http:/example.com/> against <http://example.org/foo/bar> assert_equals: href expected "http://example.org/example.com/" but got "http://example.com/"
 PASS Parsing: <ftp:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <https:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
+PASS Parsing: <madeupscheme:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <file:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <ftps:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <ftps:/example.com/> against <http://example.org/foo/bar> 
 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> 
 PASS Parsing: <javascript:/example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <mailto:/example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:/example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <http:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <ftp:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: <https:example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <madeupscheme:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "madeupscheme://"
-FAIL Parsing: <ftps:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "ftps://"
+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> 
 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> 
 PASS Parsing: <javascript:example.com/> against <http://example.org/foo/bar> 
-FAIL Parsing: <mailto:example.com/> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:example.com/> against <http://example.org/foo/bar> 
 PASS Parsing: </a/b/c> against <http://example.org/foo/bar> 
 PASS Parsing: </a/ /c> against <http://example.org/foo/bar> 
 PASS Parsing: </a%2fc> against <http://example.org/foo/bar> 
 PASS Parsing: </a/%2f/c> against <http://example.org/foo/bar> 
 FAIL Parsing: <#β> against <http://example.org/foo/bar> assert_equals: href expected "http://example.org/foo/bar#β" but got "http://example.org/foo/bar#%CE%B2"
 PASS Parsing: <data:text/html,test#test> against <http://example.org/foo/bar> 
-FAIL Parsing: <tel:1234567890> against <http://example.org/foo/bar> assert_equals: origin expected "null" but got "tel://"
+PASS Parsing: <tel:1234567890> against <http://example.org/foo/bar> 
 FAIL Parsing: <file:c:\foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:/foo/bar.html" but got "file:///tmp/mock/c:/foo/bar.html"
 FAIL Parsing: <  File:c|////foo\bar.html> against <file:///tmp/mock/path> assert_equals: href expected "file:///c:////foo/bar.html" but got "file:///tmp/mock/c|////foo/bar.html"
 FAIL Parsing: <C|/foo/bar> against <file:///tmp/mock/path> assert_equals: href expected "file:///C:/foo/bar" but got "file:///tmp/mock/C|/foo/bar"
@@ -169,7 +169,7 @@ PASS Parsing: <http://%25DOMAIN:foobar@foodomain.com/> against <about:blank>
 PASS Parsing: <http:\\www.google.com\foo> against <about:blank> 
 PASS Parsing: <http://foo:80/> against <about:blank> 
 PASS Parsing: <http://foo:81/> against <about:blank> 
-FAIL Parsing: <httpa://foo:80/> against <about:blank> assert_equals: origin expected "null" but got "httpa://foo:80"
+PASS Parsing: <httpa://foo:80/> against <about:blank> 
 PASS Parsing: <http://foo:-80/> against <about:blank> 
 PASS Parsing: <https://foo:443/> against <about:blank> 
 PASS Parsing: <https://foo:80/> against <about:blank> 
@@ -188,26 +188,26 @@ PASS Parsing: <wss://foo:815/> against <about:blank>
 PASS Parsing: <http:/example.com/> against <about:blank> 
 PASS Parsing: <ftp:/example.com/> against <about:blank> 
 PASS Parsing: <https:/example.com/> against <about:blank> 
-FAIL Parsing: <madeupscheme:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
+PASS Parsing: <madeupscheme:/example.com/> against <about:blank> 
 PASS Parsing: <file:/example.com/> against <about:blank> 
-FAIL Parsing: <ftps:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <ftps:/example.com/> against <about:blank> 
 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> 
 PASS Parsing: <javascript:/example.com/> against <about:blank> 
-FAIL Parsing: <mailto:/example.com/> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:/example.com/> against <about:blank> 
 PASS Parsing: <http:example.com/> against <about:blank> 
 PASS Parsing: <ftp:example.com/> against <about:blank> 
 PASS Parsing: <https:example.com/> against <about:blank> 
-FAIL Parsing: <madeupscheme:example.com/> against <about:blank> assert_equals: origin expected "null" but got "madeupscheme://"
-FAIL Parsing: <ftps:example.com/> against <about:blank> assert_equals: origin expected "null" but got "ftps://"
+PASS Parsing: <madeupscheme:example.com/> against <about:blank> 
+PASS Parsing: <ftps:example.com/> against <about:blank> 
 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> 
 PASS Parsing: <javascript:example.com/> against <about:blank> 
-FAIL Parsing: <mailto:example.com/> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <mailto:example.com/> against <about:blank> 
 PASS Parsing: <http:@www.example.com> against <about:blank> 
 PASS Parsing: <http:/@www.example.com> against <about:blank> 
 PASS Parsing: <http://@www.example.com> against <about:blank> 
@@ -290,11 +290,11 @@ PASS Parsing: <http://192.168.0.1 hello> against <http://other.com/>
 FAIL Parsing: <http://0Xc0.0250.01> against <http://other.com/> assert_equals: href expected "http://192.168.0.1/" but got "http://0xc0.0250.01/"
 PASS Parsing: <http://[google.com]> against <http://other.com/> 
 FAIL Parsing: <http://foo:💩@example.com/bar> against <http://other.com/> Type error
-FAIL Parsing: <#> against <test:test> assert_equals: origin expected "null" but got "test://"
-FAIL Parsing: <#x> against <mailto:x@x.com> assert_equals: origin expected "null" but got "mailto://"
+PASS Parsing: <#> against <test:test> 
+PASS Parsing: <#x> against <mailto:x@x.com> 
 PASS Parsing: <#x> against <data:,> 
 PASS Parsing: <#x> against <about:blank> 
-FAIL Parsing: <#> against <test:test?test> assert_equals: origin expected "null" but got "test://"
+PASS Parsing: <#> against <test:test?test> 
 FAIL Parsing: <https://@test@test@example:800/> against <http://doesnotmatter/> Type error
 FAIL Parsing: <https://@@@example> against <http://doesnotmatter/> Type error
 FAIL Parsing: <http://`{}:`{}@h/`{}?`{}> against <http://doesnotmatter/> Type error
@@ -303,36 +303,36 @@ PASS Parsing: <> against <http://user:pass@example.org:21/smth>
 PASS Parsing: </some/path> against <http://user:pass@example.org:21/smth> 
 PASS Parsing: <i> against <sc:sd> 
 PASS Parsing: <i> against <sc:sd/sd> 
-FAIL Parsing: <i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <i> against <sc:/pa/pa> 
+PASS Parsing: <i> against <sc://ho/pa> 
+FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/i" but got "///pa/i"
 PASS Parsing: <../i> against <sc:sd> 
 PASS Parsing: <../i> against <sc:sd/sd> 
-FAIL Parsing: <../i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <../i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <../i> against <sc:/pa/pa> 
+PASS Parsing: <../i> against <sc://ho/pa> 
+FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: pathname expected "/i" but got "///i"
 PASS Parsing: </i> against <sc:sd> 
 PASS Parsing: </i> against <sc:sd/sd> 
-FAIL Parsing: </i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: </i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
+PASS Parsing: </i> against <sc:/pa/pa> 
+PASS Parsing: </i> against <sc://ho/pa> 
 FAIL Parsing: </i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:/i"
 PASS Parsing: <?i> against <sc:sd> 
 PASS Parsing: <?i> against <sc:sd/sd> 
-FAIL Parsing: <?i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <?i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:sd> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:sd/sd> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc:/pa/pa> assert_equals: origin expected "null" but got "sc://"
-FAIL Parsing: <#i> against <sc://ho/pa> assert_equals: origin expected "null" but got "sc://ho"
-FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <?i> against <sc:/pa/pa> 
+PASS Parsing: <?i> against <sc://ho/pa> 
+FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
+PASS Parsing: <#i> against <sc:sd> 
+PASS Parsing: <#i> against <sc:sd/sd> 
+PASS Parsing: <#i> against <sc:/pa/pa> 
+PASS Parsing: <#i> against <sc://ho/pa> 
+FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
 PASS Parsing: <about:/../> against <about:blank> 
 PASS Parsing: <data:/../> against <about:blank> 
 PASS Parsing: <javascript:/../> against <about:blank> 
-FAIL Parsing: <mailto:/../> against <about:blank> assert_equals: origin expected "null" but got "mailto://"
-FAIL Parsing: <sc://ñ.test/> against <about:blank> assert_equals: origin expected "null" but got "sc://xn--ida.test"
+PASS Parsing: <mailto:/../> against <about:blank> 
+PASS Parsing: <sc://ñ.test/> against <about:blank> 
 FAIL Parsing: <sc:\../> against <about:blank> assert_equals: href expected "sc:\\../" but got "sc:/"
-FAIL Parsing: <sc::a@example.net> against <about:blank> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <sc::a@example.net> against <about:blank> 
 PASS Parsing: <http://127.0.0.1:10100/relative_import.html> against <about:blank> 
 PASS Parsing: <http://facebook.com/?foo=%7B%22abc%22> against <about:blank> 
 PASS Parsing: <https://localhost:3000/jqueryui@1.2.3> against <about:blank> 
@@ -354,5 +354,5 @@ FAIL Parsing: <??a=b&c=d> against <http://example.org/foo/bar> assert_equals: se
 PASS Parsing: <http:> against <http://example.org/foo/bar> 
 FAIL Parsing: <http:> against <https://example.org/foo/bar> assert_throws: function "function () {
           bURL(expected.input, expected.bas..." did not throw
-FAIL Parsing: <sc:> against <https://example.org/foo/bar> assert_equals: origin expected "null" but got "sc://"
+PASS Parsing: <sc:> against <https://example.org/foo/bar> 
 
index 56fc73291e85380d4b6dfb463e627cd006cd07ac..7b234a233748b6ff486e72488d6bff3cb6ea85ba 100644 (file)
@@ -1,3 +1,17 @@
+2016-09-20  Alex Christensen  <achristensen@webkit.org>
+
+        Non-special URLs should have an opaque origin
+        https://bugs.webkit.org/show_bug.cgi?id=162254
+
+        Reviewed by Sam Weinig.
+
+        Covered by newly passing web platform tests.
+
+        * page/SecurityOrigin.cpp:
+        (WebCore::shouldTreatAsUniqueOrigin):
+        According to https://url.spec.whatwg.org/#origin all URLs with non-special protocols
+        should have a unique SecurityOrigin whose serialization is "null".
+
 2016-09-20  Christopher Reid  <Christopher.Reid@am.sony.com>
 
         [WinCairo]  Not building since 206044
index b440f1d34dad638e995f41433bf109a5d166141f..fd8b60ad612b8aa98b5979ee0d8cd70cb7c35ba6 100644 (file)
@@ -58,7 +58,6 @@ bool SecurityOrigin::shouldUseInnerURL(const URL& url)
     // FIXME: Blob URLs don't have inner URLs. Their form is "blob:<inner-origin>/<UUID>", so treating the part after "blob:" as a URL is incorrect.
     if (url.protocolIsBlob())
         return true;
-    UNUSED_PARAM(url);
     return false;
 }
 
@@ -99,7 +98,12 @@ static bool shouldTreatAsUniqueOrigin(const URL& url)
         return true;
 
     // This is the common case.
-    return false;
+    return !innerURL.protocolIsInHTTPFamily()
+        && !innerURL.protocolIs("file")
+        && !innerURL.protocolIs("ftp")
+        && !innerURL.protocolIs("gopher")
+        && !innerURL.protocolIs("ws")
+        && !innerURL.protocolIs("wss");
 }
 
 SecurityOrigin::SecurityOrigin(const URL& url)