<!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>[212953] 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/212953">212953</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2017-02-24 08:45:32 -0800 (Fri, 24 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>.. should not remove windows drive letters in paths of file URLs
https://bugs.webkit.org/show_bug.cgi?id=168824

Reviewed by Youenn Fablet.

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:

It's specified in https://url.spec.whatwg.org/#shorten-a-urls-path and helps behavior for browsers on Windows.
It can't hurt to pass a few more web platform tests, though.

* platform/URLParser.cpp:
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::shouldPopPath):
(WebCore::URLParser::popPath):
(WebCore::URLParser::parse):
* platform/URLParser.h:

LayoutTests:

* fast/url/file-expected.txt:
* fast/url/file-http-base-expected.txt:
* fast/url/relative-win-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasturlfileexpectedtxt">trunk/LayoutTests/fast/url/file-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasturlfilehttpbaseexpectedtxt">trunk/LayoutTests/fast/url/file-http-base-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasturlrelativewinexpectedtxt">trunk/LayoutTests/fast/url/relative-win-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="#trunkSourceWebCoreplatformURLParserh">trunk/Source/WebCore/platform/URLParser.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/LayoutTests/ChangeLog        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-02-24  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        .. should not remove windows drive letters in paths of file URLs
+        https://bugs.webkit.org/show_bug.cgi?id=168824
+
+        Reviewed by Youenn Fablet.
+
+        * fast/url/file-expected.txt:
+        * fast/url/file-http-base-expected.txt:
+        * fast/url/relative-win-expected.txt:
+
</ins><span class="cx"> 2017-02-24  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reverting https://trac.webkit.org/r212951, landing this doesn't actually work due to Git infrastucture.
</span></span></pre></div>
<a id="trunkLayoutTestsfasturlfileexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/url/file-expected.txt (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/url/file-expected.txt        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/LayoutTests/fast/url/file-expected.txt        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> PASS canonicalize('file:///foo/bar.txt') is 'file:///foo/bar.txt'
</span><span class="cx"> FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was file:////7:////foo/bar.html.
</span><span class="cx"> FAIL canonicalize('file:filer/home\\me') should be file://filer/home/me. Was file:///tmp/mock/filer/home/me.
</span><del>-FAIL canonicalize('file:///C:/foo/../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
</del><ins>+PASS canonicalize('file:///C:/foo/../../../bar.html') is 'file:///C:/bar.html'
</ins><span class="cx"> FAIL canonicalize('file:///C:/asdf#\xc2') should be file:///C:/asdf#�. Was file:///C:/asdf#%C3%82.
</span><span class="cx"> PASS canonicalize('file:///home/me') is 'file:///home/me'
</span><span class="cx"> PASS canonicalize('file:c:\\foo\\bar.html') is 'file:///c:/foo/bar.html'
</span></span></pre></div>
<a id="trunkLayoutTestsfasturlfilehttpbaseexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/url/file-http-base-expected.txt (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/url/file-http-base-expected.txt        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/LayoutTests/fast/url/file-http-base-expected.txt        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> PASS canonicalize('file:///foo/bar.txt') is 'file:///foo/bar.txt'
</span><span class="cx"> FAIL canonicalize('FILE:/\\/\\7:\\\\//foo\\bar.html') should be file://7:////foo/bar.html. Was file:////7:////foo/bar.html.
</span><span class="cx"> FAIL canonicalize('file:filer/home\\me') should be file://filer/home/me. Was file:///filer/home/me.
</span><del>-FAIL canonicalize('file:///C:/foo/../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
</del><ins>+PASS canonicalize('file:///C:/foo/../../../bar.html') is 'file:///C:/bar.html'
</ins><span class="cx"> FAIL canonicalize('file:///C:/asdf#\xc2') should be file:///C:/asdf#Â. Was file:///C:/asdf#%C3%82.
</span><span class="cx"> FAIL canonicalize('file:///C:/asdf#Â') should be file:///C:/asdf#Â. Was file:///C:/asdf#%C3%82.
</span><span class="cx"> PASS canonicalize('file:///home/me') is 'file:///home/me'
</span></span></pre></div>
<a id="trunkLayoutTestsfasturlrelativewinexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/url/relative-win-expected.txt (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/url/relative-win-expected.txt        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/LayoutTests/fast/url/relative-win-expected.txt        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> PASS canonicalize('http://host/') is 'http://host/'
</span><span class="cx"> PASS canonicalize('bar') is 'file:///C:/bar'
</span><del>-FAIL canonicalize('../../../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
</del><ins>+PASS canonicalize('../../../bar.html') is 'file:///C:/bar.html'
</ins><span class="cx"> FAIL canonicalize('/../bar.html') should be file:///C:/bar.html. Was file:///bar.html.
</span><span class="cx"> FAIL canonicalize('\\\\another\\path') should be . Was http://another/path.
</span><span class="cx"> FAIL canonicalize('//c:/foo') should be file:///C:/foo. Was file:///c:/foo.
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-02-24  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        .. should not remove windows drive letters in paths of file URLs
+        https://bugs.webkit.org/show_bug.cgi?id=168824
+
+        Reviewed by Youenn Fablet.
+
+        * 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"> 2017-02-23  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Resource Timing] Gather timing information with reliable responseEnd time
</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 (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -383,11 +383,11 @@
</span><span class="cx"> PASS Parsing: &lt;file:///C%3A/&gt; against &lt;about:blank&gt; 
</span><span class="cx"> PASS Parsing: &lt;file:///C%7C/&gt; against &lt;about:blank&gt; 
</span><span class="cx"> PASS Parsing: &lt;pix/submit.gif&gt; against &lt;file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html&gt; 
</span><del>-FAIL Parsing: &lt;..&gt; against &lt;file:///C:/&gt; assert_equals: href expected &quot;file:///C:/&quot; but got &quot;file:///&quot;
</del><ins>+PASS Parsing: &lt;..&gt; against &lt;file:///C:/&gt; 
</ins><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///&gt; 
</span><span class="cx"> FAIL Parsing: &lt;/&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///C:/&quot; but got &quot;file:///&quot;
</span><span class="cx"> FAIL Parsing: &lt;//d:&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///d:&quot; but got &quot;file://d/&quot;
</span><del>-FAIL Parsing: &lt;//d:/..&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///d:/&quot; but got &quot;file:///&quot;
</del><ins>+PASS Parsing: &lt;//d:/..&gt; against &lt;file:///C:/a/b&gt; 
</ins><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///ab:/&gt; 
</span><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///1:/&gt; 
</span><span class="cx"> PASS Parsing: &lt;file:&gt; against &lt;about:blank&gt; 
</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 (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -383,11 +383,11 @@
</span><span class="cx"> PASS Parsing: &lt;file:///C%3A/&gt; against &lt;about:blank&gt; 
</span><span class="cx"> PASS Parsing: &lt;file:///C%7C/&gt; against &lt;about:blank&gt; 
</span><span class="cx"> PASS Parsing: &lt;pix/submit.gif&gt; against &lt;file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html&gt; 
</span><del>-FAIL Parsing: &lt;..&gt; against &lt;file:///C:/&gt; assert_equals: href expected &quot;file:///C:/&quot; but got &quot;file:///&quot;
</del><ins>+PASS Parsing: &lt;..&gt; against &lt;file:///C:/&gt; 
</ins><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///&gt; 
</span><span class="cx"> FAIL Parsing: &lt;/&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///C:/&quot; but got &quot;file:///&quot;
</span><span class="cx"> FAIL Parsing: &lt;//d:&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///d:&quot; but got &quot;file://d/&quot;
</span><del>-FAIL Parsing: &lt;//d:/..&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///d:/&quot; but got &quot;file:///&quot;
</del><ins>+PASS Parsing: &lt;//d:/..&gt; against &lt;file:///C:/a/b&gt; 
</ins><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///ab:/&gt; 
</span><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///1:/&gt; 
</span><span class="cx"> PASS Parsing: &lt;file:&gt; against &lt;about:blank&gt; 
</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 (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -391,11 +391,11 @@
</span><span class="cx"> PASS Parsing: &lt;file:///C%3A/&gt; against &lt;about:blank&gt; 
</span><span class="cx"> PASS Parsing: &lt;file:///C%7C/&gt; against &lt;about:blank&gt; 
</span><span class="cx"> PASS Parsing: &lt;pix/submit.gif&gt; against &lt;file:///C:/Users/Domenic/Dropbox/GitHub/tmpvar/jsdom/test/level2/html/files/anchor.html&gt; 
</span><del>-FAIL Parsing: &lt;..&gt; against &lt;file:///C:/&gt; assert_equals: href expected &quot;file:///C:/&quot; but got &quot;file:///&quot;
</del><ins>+PASS Parsing: &lt;..&gt; against &lt;file:///C:/&gt; 
</ins><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///&gt; 
</span><span class="cx"> FAIL Parsing: &lt;/&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///C:/&quot; but got &quot;file:///&quot;
</span><span class="cx"> FAIL Parsing: &lt;//d:&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///d:&quot; but got &quot;file://d/&quot;
</span><del>-FAIL Parsing: &lt;//d:/..&gt; against &lt;file:///C:/a/b&gt; assert_equals: href expected &quot;file:///d:/&quot; but got &quot;file:///&quot;
</del><ins>+PASS Parsing: &lt;//d:/..&gt; against &lt;file:///C:/a/b&gt; 
</ins><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///ab:/&gt; 
</span><span class="cx"> PASS Parsing: &lt;..&gt; against &lt;file:///1:/&gt; 
</span><span class="cx"> PASS Parsing: &lt;file:&gt; against &lt;about:blank&gt; 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/Source/WebCore/ChangeLog        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2017-02-24  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        .. should not remove windows drive letters in paths of file URLs
+        https://bugs.webkit.org/show_bug.cgi?id=168824
+
+        Reviewed by Youenn Fablet.
+
+        It's specified in https://url.spec.whatwg.org/#shorten-a-urls-path and helps behavior for browsers on Windows.
+        It can't hurt to pass a few more web platform tests, though.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::copyURLPartsUntil):
+        (WebCore::URLParser::shouldPopPath):
+        (WebCore::URLParser::popPath):
+        (WebCore::URLParser::parse):
+        * platform/URLParser.h:
+
</ins><span class="cx"> 2017-02-24  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac][cmake] Unreviewed buildfix after r212736.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.cpp (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.cpp        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/Source/WebCore/platform/URLParser.cpp        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -870,8 +870,11 @@
</span><span class="cx">     case Scheme::WS:
</span><span class="cx">     case Scheme::WSS:
</span><span class="cx">         isUTF8Encoding = true;
</span><ins>+        m_urlIsSpecial = true;
+        return;
+    case Scheme::File:
+        m_urlIsFile = true;
</ins><span class="cx">         FALLTHROUGH;
</span><del>-    case Scheme::File:
</del><span class="cx">     case Scheme::FTP:
</span><span class="cx">     case Scheme::Gopher:
</span><span class="cx">     case Scheme::HTTP:
</span><span class="lines">@@ -981,16 +984,31 @@
</span><span class="cx">     consumeSingleDotPathSegment(c);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool URLParser::shouldPopPath(unsigned newPathAfterLastSlash)
+{
+    ASSERT(m_didSeeSyntaxViolation);
+    if (!m_urlIsFile)
+        return true;
+
+    ASSERT(m_url.m_pathAfterLastSlash &lt;= m_asciiBuffer.size());
+    CodePointIterator&lt;LChar&gt; componentToPop(&amp;m_asciiBuffer[newPathAfterLastSlash], &amp;m_asciiBuffer[0] + m_url.m_pathAfterLastSlash);
+    if (newPathAfterLastSlash == m_url.m_portEnd + 1 &amp;&amp; isWindowsDriveLetter(componentToPop))
+        return false;
+    return true;
+}
+
</ins><span class="cx"> void URLParser::popPath()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_didSeeSyntaxViolation);
</span><span class="cx">     if (m_url.m_pathAfterLastSlash &gt; m_url.m_portEnd + 1) {
</span><del>-        m_url.m_pathAfterLastSlash--;
-        if (m_asciiBuffer[m_url.m_pathAfterLastSlash] == '/')
-            m_url.m_pathAfterLastSlash--;
-        while (m_url.m_pathAfterLastSlash &gt; m_url.m_portEnd &amp;&amp; m_asciiBuffer[m_url.m_pathAfterLastSlash] != '/')
-            m_url.m_pathAfterLastSlash--;
-        m_url.m_pathAfterLastSlash++;
</del><ins>+        auto newPathAfterLastSlash = m_url.m_pathAfterLastSlash - 1;
+        if (m_asciiBuffer[newPathAfterLastSlash] == '/')
+            newPathAfterLastSlash--;
+        while (newPathAfterLastSlash &gt; m_url.m_portEnd &amp;&amp; m_asciiBuffer[newPathAfterLastSlash] != '/')
+            newPathAfterLastSlash--;
+        newPathAfterLastSlash++;
+        if (shouldPopPath(newPathAfterLastSlash))
+            m_url.m_pathAfterLastSlash = newPathAfterLastSlash;
</ins><span class="cx">     }
</span><span class="cx">     m_asciiBuffer.resize(m_url.m_pathAfterLastSlash);
</span><span class="cx"> }
</span><span class="lines">@@ -1207,6 +1225,7 @@
</span><span class="cx">                 switch (scheme(urlScheme)) {
</span><span class="cx">                 case Scheme::File:
</span><span class="cx">                     m_urlIsSpecial = true;
</span><ins>+                    m_urlIsFile = true;
</ins><span class="cx">                     state = State::File;
</span><span class="cx">                     ++c;
</span><span class="cx">                     break;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.h (212952 => 212953)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.h        2017-02-24 13:17:48 UTC (rev 212952)
+++ trunk/Source/WebCore/platform/URLParser.h        2017-02-24 16:45:32 UTC (rev 212953)
</span><span class="lines">@@ -57,6 +57,7 @@
</span><span class="cx">     URL m_url;
</span><span class="cx">     Vector&lt;LChar&gt; m_asciiBuffer;
</span><span class="cx">     bool m_urlIsSpecial { false };
</span><ins>+    bool m_urlIsFile { false };
</ins><span class="cx">     bool m_hostHasPercentOrNonASCII { false };
</span><span class="cx">     String m_inputString;
</span><span class="cx">     const void* m_inputBegin { nullptr };
</span><span class="lines">@@ -123,6 +124,7 @@
</span><span class="cx">     template&lt;typename CharacterType&gt; void copyURLPartsUntil(const URL&amp; base, URLPart, const CodePointIterator&lt;CharacterType&gt;&amp;, bool&amp; isUTF8Encoding);
</span><span class="cx">     static size_t urlLengthUntilPart(const URL&amp;, URLPart);
</span><span class="cx">     void popPath();
</span><ins>+    bool shouldPopPath(unsigned);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>