<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208508] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208508">208508</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-11-09 16:30:31 -0800 (Wed, 09 Nov 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>URLParser should not consider path of URLs with no host to start at the first slash after the colon
https://bugs.webkit.org/show_bug.cgi?id=164555
Patch by Alex Christensen <achristensen@webkit.org> on 2016-11-09
Reviewed by Tim Horton.
LayoutTests/imported/w3c:
* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:
Source/WebCore:
When we see a url that is only scheme:// we treated the // as the path. Firefox did this with unrecognized schemes,
but based on https://github.com/whatwg/url/issues/148 they seem willing to change. We had added similar behavior to
URL::parse, and I added this to URLParser in <a href="http://trac.webkit.org/projects/webkit/changeset/206783">r206783</a> which this effectively reverts.
Covered by API and layout tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Don't move m_userStart to m_pathStart back by two when we see an empty host.
Tools:
* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):
LayoutTests:
* fast/url/segments-expected.txt:
* fast/url/segments-from-data-url-expected.txt:
* fast/loader/url-parse-1-expected.txt:
* fetch/fetch-url-serialization-expected.txt:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastloaderurlparse1expectedtxt">trunk/LayoutTests/fast/loader/url-parse-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasturlsegmentsexpectedtxt">trunk/LayoutTests/fast/url/segments-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasturlsegmentsfromdataurlexpectedtxt">trunk/LayoutTests/fast/url/segments-from-data-url-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfetchfetchurlserializationexpectedtxt">trunk/LayoutTests/fetch/fetch-url-serialization-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsurlaelementexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsurlaelementxhtmlexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsurlurlconstructorexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformURLParsercpp">trunk/Source/WebCore/platform/URLParser.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebCoreURLParsercpp">trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/ChangeLog        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-11-09 Alex Christensen <achristensen@webkit.org>
+
+ URLParser should not consider path of URLs with no host to start at the first slash after the colon
+ https://bugs.webkit.org/show_bug.cgi?id=164555
+
+ Reviewed by Tim Horton.
+
+ * fast/url/segments-expected.txt:
+ * fast/url/segments-from-data-url-expected.txt:
+ * fast/loader/url-parse-1-expected.txt:
+ * fetch/fetch-url-serialization-expected.txt:
+
</ins><span class="cx"> 2016-11-09 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Implement visual-viewport based position:fixed handling for Mac async scrolling
</span></span></pre></div>
<a id="trunkLayoutTestsfastloaderurlparse1expectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/loader/url-parse-1-expected.txt (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/loader/url-parse-1-expected.txt        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/fast/loader/url-parse-1-expected.txt        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> x-webkit:test        x-webkit:test                test
</span><span class="cx"> x-webkit:/        x-webkit:/                /
</span><span class="cx"> x-webkit:/test        x-webkit:/test                /test
</span><del>-x-webkit://        x-webkit://                //
</del><ins>+x-webkit://        x-webkit://                
</ins><span class="cx"> x-webkit://test        x-webkit://test        test        
</span><del>-x-webkit:///        x-webkit:///                ///
-x-webkit:///test        x-webkit:///test                ///test
</del><ins>+x-webkit:///        x-webkit:///                /
+x-webkit:///test        x-webkit:///test                /test
</ins></span></pre></div>
<a id="trunkLayoutTestsfasturlsegmentsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/url/segments-expected.txt (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/url/segments-expected.txt        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/fast/url/segments-expected.txt        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> PASS segments('//') is '[":","","","","",""]'
</span><span class="cx"> PASS segments('::') is '["http:","example.org","","/foo/::","",""]'
</span><span class="cx"> PASS segments('::23') is '["http:","example.org","","/foo/::23","",""]'
</span><del>-PASS segments('foo://') is '["foo:","","","//","",""]'
</del><ins>+FAIL segments('foo://') should be ["foo:","","","//","",""]. Was ["foo:","","","","",""].
</ins><span class="cx"> PASS segments('http://a:b@c:29/d') is '["http:","c","29","/d","",""]'
</span><span class="cx"> PASS segments('http::@c:29') is '["http:","example.org","","/foo/:@c:29","",""]'
</span><span class="cx"> PASS segments('http://&a:foo(b]c@d:2/') is '["http:","d","2","/","",""]'
</span><span class="lines">@@ -50,9 +50,9 @@
</span><span class="cx"> PASS segments('http:\\\\a\\b:c\\d@foo.com\\') is '["http:","a","","/b:c/d@foo.com/","",""]'
</span><span class="cx"> PASS segments('foo:/') is '["foo:","","","/","",""]'
</span><span class="cx"> PASS segments('foo:/bar.com/') is '["foo:","","","/bar.com/","",""]'
</span><del>-PASS segments('foo://///////') is '["foo:","","","/////////","",""]'
-PASS segments('foo://///////bar.com/') is '["foo:","","","/////////bar.com/","",""]'
-PASS segments('foo:////://///') is '["foo:","","","////://///","",""]'
</del><ins>+FAIL segments('foo://///////') should be ["foo:","","","/////////","",""]. Was ["foo:","","","///////","",""].
+FAIL segments('foo://///////bar.com/') should be ["foo:","","","/////////bar.com/","",""]. Was ["foo:","","","///////bar.com/","",""].
+FAIL segments('foo:////://///') should be ["foo:","","","////://///","",""]. Was ["foo:","","","//://///","",""].
</ins><span class="cx"> PASS segments('c:/foo') is '["c:","","","/foo","",""]'
</span><span class="cx"> PASS segments('//foo/bar') is '["http:","foo","","/bar","",""]'
</span><span class="cx"> PASS segments('http://foo/path;a??e#f#g') is '["http:","foo","","/path;a","??e","#f#g"]'
</span></span></pre></div>
<a id="trunkLayoutTestsfasturlsegmentsfromdataurlexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/url/segments-from-data-url-expected.txt (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/url/segments-from-data-url-expected.txt        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/fast/url/segments-from-data-url-expected.txt        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> PASS segments('//') is '[":","","","","",""]'
</span><span class="cx"> PASS segments('::') is '[":","","","","",""]'
</span><span class="cx"> PASS segments('::23') is '[":","","","","",""]'
</span><del>-PASS segments('foo://') is '["foo:","","","//","",""]'
</del><ins>+FAIL segments('foo://') should be ["foo:","","","//","",""]. Was ["foo:","","","","",""].
</ins><span class="cx"> PASS segments('http://a:b@c:29/d') is '["http:","c","29","/d","",""]'
</span><span class="cx"> PASS segments('http::@c:29') is '["http:","c","29","/","",""]'
</span><span class="cx"> PASS segments('http://&a:foo(b]c@d:2/') is '["http:","d","2","/","",""]'
</span><span class="lines">@@ -50,9 +50,9 @@
</span><span class="cx"> PASS segments('http:\\\\a\\b:c\\d@foo.com\\') is '["http:","a","","/b:c/d@foo.com/","",""]'
</span><span class="cx"> PASS segments('foo:/') is '["foo:","","","/","",""]'
</span><span class="cx"> PASS segments('foo:/bar.com/') is '["foo:","","","/bar.com/","",""]'
</span><del>-PASS segments('foo://///////') is '["foo:","","","/////////","",""]'
-PASS segments('foo://///////bar.com/') is '["foo:","","","/////////bar.com/","",""]'
-PASS segments('foo:////://///') is '["foo:","","","////://///","",""]'
</del><ins>+FAIL segments('foo://///////') should be ["foo:","","","/////////","",""]. Was ["foo:","","","///////","",""].
+FAIL segments('foo://///////bar.com/') should be ["foo:","","","/////////bar.com/","",""]. Was ["foo:","","","///////bar.com/","",""].
+FAIL segments('foo:////://///') should be ["foo:","","","////://///","",""]. Was ["foo:","","","//://///","",""].
</ins><span class="cx"> PASS segments('c:/foo') is '["c:","","","/foo","",""]'
</span><span class="cx"> PASS segments('//foo/bar') is '[":","","","","",""]'
</span><span class="cx"> PASS segments('http://foo/path;a??e#f#g') is '["http:","foo","","/path;a","??e","#f#g"]'
</span></span></pre></div>
<a id="trunkLayoutTestsfetchfetchurlserializationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fetch/fetch-url-serialization-expected.txt (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fetch/fetch-url-serialization-expected.txt        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/fetch/fetch-url-serialization-expected.txt        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx"> PASS Testing Request url '/i' with base 'sc:sd/sd'
</span><span class="cx"> PASS Testing Request url '/i' with base 'sc:/pa/pa'
</span><span class="cx"> PASS Testing Request url '/i' with base 'sc://ho/pa'
</span><del>-FAIL Testing Request url '/i' with base 'sc:///pa/pa' assert_equals: expected "sc:///i" but got "sc:/i"
</del><ins>+PASS Testing Request url '/i' with base 'sc:///pa/pa'
</ins><span class="cx"> PASS Testing Request url '?i' with base 'sc:sd'
</span><span class="cx"> PASS Testing Request url '?i' with base 'sc:sd/sd'
</span><span class="cx"> PASS Testing Request url '?i' with base 'sc:/pa/pa'
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-11-09 Alex Christensen <achristensen@webkit.org>
+
+ URLParser should not consider path of URLs with no host to start at the first slash after the colon
+ https://bugs.webkit.org/show_bug.cgi?id=164555
+
+ Reviewed by Tim Horton.
+
+ * 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:
+
</ins><span class="cx"> 2016-11-09 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> IndexedDB 2.0: W3C test IndexedDB/idbtransaction_objectStoreNames.html fails.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsurlaelementexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -50,9 +50,9 @@
</span><span class="cx"> PASS Parsing: <http:\\a\b:c\d@foo.com\> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <foo:/> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <foo:/bar.com/> against <http://example.org/foo/bar>
</span><del>-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 "////://///"
</del><ins>+PASS Parsing: <foo://///////> against <http://example.org/foo/bar>
+PASS Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar>
+PASS Parsing: <foo:////://///> against <http://example.org/foo/bar>
</ins><span class="cx"> PASS Parsing: <c:/foo> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <//foo/bar> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <http://foo/path;a??e#f#g> against <http://example.org/foo/bar>
</span><span class="lines">@@ -288,27 +288,27 @@
</span><span class="cx"> PASS Parsing: <i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/i" but got "///pa/i"
</del><ins>+PASS Parsing: <i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <../i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <../i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <../i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <../i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: pathname expected "/i" but got "///i"
</del><ins>+PASS Parsing: <../i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: </i> against <sc:sd>
</span><span class="cx"> PASS Parsing: </i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: </i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: </i> against <sc://ho/pa>
</span><del>-FAIL Parsing: </i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:/i"
</del><ins>+PASS Parsing: </i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <?i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <?i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <?i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <?i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
</del><ins>+PASS Parsing: <?i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <#i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <#i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <#i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <#i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
</del><ins>+PASS Parsing: <#i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <about:/../> against <about:blank>
</span><span class="cx"> PASS Parsing: <data:/../> against <about:blank>
</span><span class="cx"> PASS Parsing: <javascript:/../> against <about:blank>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsurlaelementxhtmlexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -50,9 +50,9 @@
</span><span class="cx"> PASS Parsing: <http:\\a\b:c\d@foo.com\> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <foo:/> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <foo:/bar.com/> against <http://example.org/foo/bar>
</span><del>-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 "////://///"
</del><ins>+PASS Parsing: <foo://///////> against <http://example.org/foo/bar>
+PASS Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar>
+PASS Parsing: <foo:////://///> against <http://example.org/foo/bar>
</ins><span class="cx"> PASS Parsing: <c:/foo> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <//foo/bar> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <http://foo/path;a??e#f#g> against <http://example.org/foo/bar>
</span><span class="lines">@@ -288,27 +288,27 @@
</span><span class="cx"> PASS Parsing: <i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/i" but got "///pa/i"
</del><ins>+PASS Parsing: <i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <../i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <../i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <../i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <../i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: pathname expected "/i" but got "///i"
</del><ins>+PASS Parsing: <../i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: </i> against <sc:sd>
</span><span class="cx"> PASS Parsing: </i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: </i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: </i> against <sc://ho/pa>
</span><del>-FAIL Parsing: </i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:/i"
</del><ins>+PASS Parsing: </i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <?i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <?i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <?i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <?i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
</del><ins>+PASS Parsing: <?i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <#i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <#i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <#i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <#i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
</del><ins>+PASS Parsing: <#i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <about:/../> against <about:blank>
</span><span class="cx"> PASS Parsing: <data:/../> against <about:blank>
</span><span class="cx"> PASS Parsing: <javascript:/../> against <about:blank>
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsurlurlconstructorexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -54,9 +54,9 @@
</span><span class="cx"> PASS Parsing: <http:\\a\b:c\d@foo.com\> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <foo:/> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <foo:/bar.com/> against <http://example.org/foo/bar>
</span><del>-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 "////://///"
</del><ins>+PASS Parsing: <foo://///////> against <http://example.org/foo/bar>
+PASS Parsing: <foo://///////bar.com/> against <http://example.org/foo/bar>
+PASS Parsing: <foo:////://///> against <http://example.org/foo/bar>
</ins><span class="cx"> PASS Parsing: <c:/foo> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <//foo/bar> against <http://example.org/foo/bar>
</span><span class="cx"> PASS Parsing: <http://foo/path;a??e#f#g> against <http://example.org/foo/bar>
</span><span class="lines">@@ -293,27 +293,27 @@
</span><span class="cx"> PASS Parsing: <i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/i" but got "///pa/i"
</del><ins>+PASS Parsing: <i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <../i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <../i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <../i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <../i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <../i> against <sc:///pa/pa> assert_equals: pathname expected "/i" but got "///i"
</del><ins>+PASS Parsing: <../i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: </i> against <sc:sd>
</span><span class="cx"> PASS Parsing: </i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: </i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: </i> against <sc://ho/pa>
</span><del>-FAIL Parsing: </i> against <sc:///pa/pa> assert_equals: href expected "sc:///i" but got "sc:/i"
</del><ins>+PASS Parsing: </i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <?i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <?i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <?i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <?i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <?i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
</del><ins>+PASS Parsing: <?i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <#i> against <sc:sd>
</span><span class="cx"> PASS Parsing: <#i> against <sc:sd/sd>
</span><span class="cx"> PASS Parsing: <#i> against <sc:/pa/pa>
</span><span class="cx"> PASS Parsing: <#i> against <sc://ho/pa>
</span><del>-FAIL Parsing: <#i> against <sc:///pa/pa> assert_equals: pathname expected "/pa/pa" but got "///pa/pa"
</del><ins>+PASS Parsing: <#i> against <sc:///pa/pa>
</ins><span class="cx"> PASS Parsing: <about:/../> against <about:blank>
</span><span class="cx"> PASS Parsing: <data:/../> against <about:blank>
</span><span class="cx"> PASS Parsing: <javascript:/../> against <about:blank>
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/Source/WebCore/ChangeLog        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -1,5 +1,22 @@
</span><span class="cx"> 2016-11-09 Alex Christensen <achristensen@webkit.org>
</span><span class="cx">
</span><ins>+ URLParser should not consider path of URLs with no host to start at the first slash after the colon
+ https://bugs.webkit.org/show_bug.cgi?id=164555
+
+ Reviewed by Tim Horton.
+
+ When we see a url that is only scheme:// we treated the // as the path. Firefox did this with unrecognized schemes,
+ but based on https://github.com/whatwg/url/issues/148 they seem willing to change. We had added similar behavior to
+ URL::parse, and I added this to URLParser in r206783 which this effectively reverts.
+
+ Covered by API and layout tests.
+
+ * platform/URLParser.cpp:
+ (WebCore::URLParser::parse):
+ Don't move m_userStart to m_pathStart back by two when we see an empty host.
+
+2016-11-09 Alex Christensen <achristensen@webkit.org>
+
</ins><span class="cx"> Simplify logic of SecurityOrigin::databaseIdentifier
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=164565
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.cpp (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.cpp        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/Source/WebCore/platform/URLParser.cpp        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -1427,17 +1427,11 @@
</span><span class="cx"> if (isSlash || *c == '?' || *c == '#') {
</span><span class="cx"> auto iterator = CodePointIterator<CharacterType>(authorityOrHostBegin, c);
</span><span class="cx"> if (iterator.atEnd()) {
</span><del>- size_t position = currentPosition(c);
- ASSERT(m_url.m_userStart == position);
- RELEASE_ASSERT(position >= 2);
- position -= 2;
- ASSERT(parsedDataView(position, 2) == "//");
- m_url.m_userStart = position;
- m_url.m_userEnd = position;
- m_url.m_passwordEnd = position;
- m_url.m_hostEnd = position;
- m_url.m_portEnd = position;
- m_url.m_pathAfterLastSlash = position + 2;
</del><ins>+ m_url.m_userEnd = currentPosition(c);
+ m_url.m_passwordEnd = m_url.m_userEnd;
+ m_url.m_hostEnd = m_url.m_userEnd;
+ m_url.m_portEnd = m_url.m_userEnd;
+ m_url.m_pathAfterLastSlash = m_url.m_userEnd;
</ins><span class="cx"> } else {
</span><span class="cx"> m_url.m_userEnd = currentPosition(authorityOrHostBegin);
</span><span class="cx"> m_url.m_passwordEnd = m_url.m_userEnd;
</span><span class="lines">@@ -1835,14 +1829,11 @@
</span><span class="cx"> m_url.m_userEnd = currentPosition(authorityOrHostBegin);
</span><span class="cx"> m_url.m_passwordEnd = m_url.m_userEnd;
</span><span class="cx"> if (authorityOrHostBegin.atEnd()) {
</span><del>- RELEASE_ASSERT(m_url.m_userStart >= 2);
- ASSERT(parsedDataView(m_url.m_userStart - 2, 2) == "//");
- m_url.m_userStart -= 2;
</del><span class="cx"> m_url.m_userEnd = m_url.m_userStart;
</span><span class="cx"> m_url.m_passwordEnd = m_url.m_userStart;
</span><span class="cx"> m_url.m_hostEnd = m_url.m_userStart;
</span><span class="cx"> m_url.m_portEnd = m_url.m_userStart;
</span><del>- m_url.m_pathEnd = m_url.m_userStart + 2;
</del><ins>+ m_url.m_pathEnd = m_url.m_userStart;
</ins><span class="cx"> } else if (!parseHostAndPort(authorityOrHostBegin)) {
</span><span class="cx"> failure();
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/Tools/ChangeLog        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-11-09 Alex Christensen <achristensen@webkit.org>
+
+ URLParser should not consider path of URLs with no host to start at the first slash after the colon
+ https://bugs.webkit.org/show_bug.cgi?id=164555
+
+ Reviewed by Tim Horton.
+
+ * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+ (TestWebKitAPI::TEST_F):
+
</ins><span class="cx"> 2016-11-09 Jonathan Bedard <jbedard@apple.com>
</span><span class="cx">
</span><span class="cx"> test-webkitpy failing test_create_patch_is_full_patch unit test
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (208507 => 208508)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp        2016-11-10 00:18:54 UTC (rev 208507)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp        2016-11-10 00:30:31 UTC (rev 208508)
</span><span class="lines">@@ -511,20 +511,38 @@
</span><span class="cx"> checkURL("http://host:123?query", {"http", "", "", "host", 123, "/", "query", "", "http://host:123/?query"});
</span><span class="cx"> checkURL("http://host:123#", {"http", "", "", "host", 123, "/", "", "", "http://host:123/#"});
</span><span class="cx"> checkURL("http://host:123#fragment", {"http", "", "", "host", 123, "/", "", "fragment", "http://host:123/#fragment"});
</span><del>- checkURL("foo:////", {"foo", "", "", "", 0, "////", "", "", "foo:////"});
- checkURL("foo:///?", {"foo", "", "", "", 0, "///", "", "", "foo:///?"});
- checkURL("foo:///#", {"foo", "", "", "", 0, "///", "", "", "foo:///#"});
- checkURL("foo:///", {"foo", "", "", "", 0, "///", "", "", "foo:///"});
- checkURL("foo://?", {"foo", "", "", "", 0, "//", "", "", "foo://?"});
- checkURL("foo://#", {"foo", "", "", "", 0, "//", "", "", "foo://#"});
- checkURL("foo://", {"foo", "", "", "", 0, "//", "", "", "foo://"});
</del><ins>+ checkURLDifferences("foo:////",
+ {"foo", "", "", "", 0, "//", "", "", "foo:////"},
+ {"foo", "", "", "", 0, "////", "", "", "foo:////"});
+ checkURLDifferences("foo:///?",
+ {"foo", "", "", "", 0, "/", "", "", "foo:///?"},
+ {"foo", "", "", "", 0, "///", "", "", "foo:///?"});
+ checkURLDifferences("foo:///#",
+ {"foo", "", "", "", 0, "/", "", "", "foo:///#"},
+ {"foo", "", "", "", 0, "///", "", "", "foo:///#"});
+ checkURLDifferences("foo:///",
+ {"foo", "", "", "", 0, "/", "", "", "foo:///"},
+ {"foo", "", "", "", 0, "///", "", "", "foo:///"});
+ checkURLDifferences("foo://?",
+ {"foo", "", "", "", 0, "", "", "", "foo://?"},
+ {"foo", "", "", "", 0, "//", "", "", "foo://?"});
+ checkURLDifferences("foo://#",
+ {"foo", "", "", "", 0, "", "", "", "foo://#"},
+ {"foo", "", "", "", 0, "//", "", "", "foo://#"});
+ checkURLDifferences("foo://",
+ {"foo", "", "", "", 0, "", "", "", "foo://"},
+ {"foo", "", "", "", 0, "//", "", "", "foo://"});
</ins><span class="cx"> checkURL("foo:/?", {"foo", "", "", "", 0, "/", "", "", "foo:/?"});
</span><span class="cx"> checkURL("foo:/#", {"foo", "", "", "", 0, "/", "", "", "foo:/#"});
</span><span class="cx"> checkURL("foo:/", {"foo", "", "", "", 0, "/", "", "", "foo:/"});
</span><span class="cx"> checkURL("foo:?", {"foo", "", "", "", 0, "", "", "", "foo:?"});
</span><span class="cx"> checkURL("foo:#", {"foo", "", "", "", 0, "", "", "", "foo:#"});
</span><del>- checkURL("A://", {"a", "", "", "", 0, "//", "", "", "a://"});
- checkURL("aA://", {"aa", "", "", "", 0, "//", "", "", "aa://"});
</del><ins>+ checkURLDifferences("A://",
+ {"a", "", "", "", 0, "", "", "", "a://"},
+ {"a", "", "", "", 0, "//", "", "", "a://"});
+ checkURLDifferences("aA://",
+ {"aa", "", "", "", 0, "", "", "", "aa://"},
+ {"aa", "", "", "", 0, "//", "", "", "aa://"});
</ins><span class="cx"> checkURL(utf16String(u"foo://host/#ПП\u0007 a</"), {"foo", "", "", "host", 0, "/", "", "%D0%9F%D0%9F%07 a</", "foo://host/#%D0%9F%D0%9F%07 a</"});
</span><span class="cx"> checkURL(utf16String(u"foo://host/#\u0007 a</"), {"foo", "", "", "host", 0, "/", "", "%07 a</", "foo://host/#%07 a</"});
</span><span class="cx"> checkURL(utf16String(u"http://host?ß😍#ß😍"), {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", "%C3%9F%F0%9F%98%8D", "http://host/?%C3%9F%F0%9F%98%8D#%C3%9F%F0%9F%98%8D"}, testTabsValueForSurrogatePairs);
</span><span class="lines">@@ -612,7 +630,9 @@
</span><span class="cx"> checkRelativeURL(" ", "http://host/#fragment", {"http", "", "", "host", 0, "/", "", "", "http://host/"});
</span><span class="cx"> checkRelativeURL(" ", "http://host/path?query#fra#gment", {"http", "", "", "host", 0, "/path", "query", "", "http://host/path?query"});
</span><span class="cx"> checkRelativeURL(" \a ", "http://host/#fragment", {"http", "", "", "host", 0, "/", "", "", "http://host/"});
</span><del>- checkRelativeURL("foo://", "http://example.org/foo/bar", {"foo", "", "", "", 0, "//", "", "", "foo://"});
</del><ins>+ checkRelativeURLDifferences("foo://", "http://example.org/foo/bar",
+ {"foo", "", "", "", 0, "", "", "", "foo://"},
+ {"foo", "", "", "", 0, "//", "", "", "foo://"});
</ins><span class="cx"> checkRelativeURL(utf16String(u"#β"), "http://example.org/foo/bar", {"http", "", "", "example.org", 0, "/foo/bar", "", "%CE%B2", "http://example.org/foo/bar#%CE%B2"});
</span><span class="cx">
</span><span class="cx"> // The checking of slashes in SpecialAuthoritySlashes needed to get this to pass contradicts what is in the spec,
</span><span class="lines">@@ -883,10 +903,10 @@
</span><span class="cx"> {"", "", "", "", 0, "", "", "", "http://:"},
</span><span class="cx"> {"http", "", "", "", 0, "/", "", "", "http://:/"});
</span><span class="cx"> checkURLDifferences("http:##foo",
</span><del>- {"http", "", "", "", 0, "//", "", "#foo", "http://##foo"},
</del><ins>+ {"http", "", "", "", 0, "", "", "#foo", "http://##foo"},
</ins><span class="cx"> {"http", "", "", "", 0, "/", "", "#foo", "http:/##foo"});
</span><span class="cx"> checkURLDifferences("http:??bar",
</span><del>- {"http", "", "", "", 0, "//", "?bar", "", "http://??bar"},
</del><ins>+ {"http", "", "", "", 0, "", "?bar", "", "http://??bar"},
</ins><span class="cx"> {"http", "", "", "", 0, "/", "?bar", "", "http:/??bar"});
</span><span class="cx"> checkRelativeURLDifferences("//C|/foo/bar", "file:///tmp/mock/path",
</span><span class="cx"> {"file", "", "", "", 0, "/C:/foo/bar", "", "", "file:///C:/foo/bar"},
</span></span></pre>
</div>
</div>
</body>
</html>