<!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>[224823] 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/224823">224823</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2017-11-14 11:15:23 -0800 (Tue, 14 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clean up old URL parser remnants
https://bugs.webkit.org/show_bug.cgi?id=179573

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/url/url-setters-expected.txt:
We're more spec compliant!  Hooray!

Source/WebCore:

When we transitioned to the new URLParser, we kept the old character tables which were less spec-conformant.
Removing them and transitioning to URLParser's table makes more web platform tests pass!

* fileapi/BlobURL.cpp:
(WebCore::BlobURL::createBlobURL):
There's no need to percent-encode an origin.  It's already ascii, and if it's not, then the URLParser will escape it.
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::createFileURL):
Removed comment that no longer applies.
* platform/URL.cpp:
(WebCore::URL::setProtocol):
(WebCore::percentEncodeCharacters):
(WebCore::URL::setUser):
(WebCore::URL::setPass):
Percent encode the userinfo character set from the URLParser according to https://url.spec.whatwg.org/#set-the-username and https://url.spec.whatwg.org/#set-the-password
(WebCore::URL::setPath):
A ? or a # are the only two characters that need to be pre-encoded when setting the path because they indicate the
beginning of a query or fragment.  All other characters will be encoded if necessary during parsing.
(WebCore::protocolIsInternal):
(): Deleted.
(WebCore::isSchemeFirstChar): Deleted.
(WebCore::isSchemeChar): Deleted.
(WebCore::isBadChar): Deleted.
(WebCore::isTabNewline): Deleted.
(WebCore::appendEscapedChar): Deleted.
(WebCore::encodeWithURLEscapeSequences):
Encode characters needed.  I used the user info set of characters because that was most similar to the BadChar set of the old parser.
This isn't standardized, and it's only used for the search context menu item which certainly isn't standardized.
(WebCore::isValidProtocol): Deleted.
Remove a bunch of old unused functions.
* platform/URLParser.cpp:
(WebCore::URLParser::isInUserInfoEncodeSet):
(WebCore::URLParser::parseAuthority):
* platform/URLParser.h:
Expose a few functions for URL.cpp to use.

Source/WebKit:

* WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
(WebKit::WebContextMenuClient::searchWithGoogle):
Use https if we do end up searching with google.

Source/WebKitLegacy/win:

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::searchWithGoogle):
Use https if we do end up searching with google.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsurlurlsettersexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobURLcpp">trunk/Source/WebCore/fileapi/BlobURL.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderappcacheApplicationCacheHostcpp">trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformURLcpp">trunk/Source/WebCore/platform/URL.cpp</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>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebContextMenuClientcpp">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.cpp</a></li>
<li><a href="#trunkSourceWebKitLegacywinChangeLog">trunk/Source/WebKitLegacy/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacywinWebCoreSupportWebContextMenuClientcpp">trunk/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-11-14  Alex Christensen  <achristensen@webkit.org>
+
+        Clean up old URL parser remnants
+        https://bugs.webkit.org/show_bug.cgi?id=179573
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/url/url-setters-expected.txt:
+        We're more spec compliant!  Hooray!
+
</ins><span class="cx"> 2017-11-13  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Send ServiceWorkerData structs to the WebProcesses instead of ServiceWorkerIdentifiers
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsurlurlsettersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt   2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt      2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -495,21 +495,21 @@
</span><span class="cx"> PASS URL: Setting <https://example.net#nav>.pathname = '../home' 
</span><span class="cx"> PASS <a>: Setting <https://example.net#nav>.pathname = '../home' 
</span><span class="cx"> PASS <area>: Setting <https://example.net#nav>.pathname = '../home' 
</span><del>-FAIL URL: Setting <http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is a segment delimiter for 'special' URLs assert_equals: expected "http://example.net/a/c?lang=fr#nav" but got "http://example.net//a/%252E/b/%252e./c?lang=fr#nav"
-FAIL <a>: Setting <http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is a segment delimiter for 'special' URLs assert_equals: expected "http://example.net/a/c?lang=fr#nav" but got "http://example.net//a/%252E/b/%252e./c?lang=fr#nav"
-FAIL <area>: Setting <http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is a segment delimiter for 'special' URLs assert_equals: expected "http://example.net/a/c?lang=fr#nav" but got "http://example.net//a/%252E/b/%252e./c?lang=fr#nav"
-FAIL URL: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is *not* a segment delimiter for non-'special' URLs assert_equals: expected "view-source+http://example.net/\\a\%2E\b\%2e.\c?lang=fr#nav" but got "view-source+http://example.net/\\a\%252E\b\%252e.\c?lang=fr#nav"
-FAIL <a>: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is *not* a segment delimiter for non-'special' URLs assert_equals: expected "view-source+http://example.net/\\a\%2E\b\%2e.\c?lang=fr#nav" but got "view-source+http://example.net/\\a\%252E\b\%252e.\c?lang=fr#nav"
-FAIL <area>: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is *not* a segment delimiter for non-'special' URLs assert_equals: expected "view-source+http://example.net/\\a\%2E\b\%2e.\c?lang=fr#nav" but got "view-source+http://example.net/\\a\%252E\b\%252e.\c?lang=fr#nav"
</del><ins>+FAIL URL: Setting <http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is a segment delimiter for 'special' URLs assert_equals: expected "http://example.net/a/c?lang=fr#nav" but got "http://example.net//a/c?lang=fr#nav"
+FAIL <a>: Setting <http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is a segment delimiter for 'special' URLs assert_equals: expected "http://example.net/a/c?lang=fr#nav" but got "http://example.net//a/c?lang=fr#nav"
+FAIL <area>: Setting <http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is a segment delimiter for 'special' URLs assert_equals: expected "http://example.net/a/c?lang=fr#nav" but got "http://example.net//a/c?lang=fr#nav"
+PASS URL: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is *not* a segment delimiter for non-'special' URLs 
+PASS <a>: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is *not* a segment delimiter for non-'special' URLs 
+PASS <area>: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\a\%2E\b\%2e.\c' \ is *not* a segment delimiter for non-'special' URLs 
</ins><span class="cx"> FAIL URL: Setting <a:/>.pathname = '\0     
</span><del>-\r !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~€Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed. assert_equals: expected "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9" but got "a:/%00%01%09%0A%0D%1F%20!%22%23$%25&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
</del><ins>+\r !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~€Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed. assert_equals: expected "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9" but got "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C3%82%C2%80%C3%82%C2%81%C3%83%C2%89%C3%83%C2%A9"
</ins><span class="cx"> FAIL <a>: Setting <a:/>.pathname = '\0       
</span><del>-\r !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~€Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed. assert_equals: expected "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9" but got "a:/%00%01%09%0A%0D%1F%20!%22%23$%25&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
</del><ins>+\r !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~€Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed. assert_equals: expected "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9" but got "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C3%82%C2%80%C3%82%C2%81%C3%83%C2%89%C3%83%C2%A9"
</ins><span class="cx"> FAIL <area>: Setting <a:/>.pathname = '\0    
</span><del>-\r !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~€Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed. assert_equals: expected "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9" but got "a:/%00%01%09%0A%0D%1F%20!%22%23$%25&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
-FAIL URL: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, including %2E outside dotted segments. assert_equals: expected "http://example.net/%2e%2E%c3%89t%C3%A9" but got "http://example.net/%252e%252E%25c3%2589t%C3%A9"
-FAIL <a>: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, including %2E outside dotted segments. assert_equals: expected "http://example.net/%2e%2E%c3%89t%C3%A9" but got "http://example.net/%252e%252E%25c3%2589t%C3%A9"
-FAIL <area>: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, including %2E outside dotted segments. assert_equals: expected "http://example.net/%2e%2E%c3%89t%C3%A9" but got "http://example.net/%252e%252E%25c3%2589t%C3%A9"
</del><ins>+\r !"#$%&'()*+,-./09:;<=>?@AZ[\]^_`az{|}~€Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed. assert_equals: expected "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9" but got "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C3%82%C2%80%C3%82%C2%81%C3%83%C2%89%C3%83%C2%A9"
+PASS URL: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, including %2E outside dotted segments. 
+PASS <a>: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, including %2E outside dotted segments. 
+PASS <area>: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, including %2E outside dotted segments. 
</ins><span class="cx"> PASS URL: Setting <http://example.net>.pathname = '?' ? needs to be encoded 
</span><span class="cx"> PASS <a>: Setting <http://example.net>.pathname = '?' ? needs to be encoded 
</span><span class="cx"> PASS <area>: Setting <http://example.net>.pathname = '?' ? needs to be encoded 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebCore/ChangeLog      2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2017-11-14  Alex Christensen  <achristensen@webkit.org>
+
+        Clean up old URL parser remnants
+        https://bugs.webkit.org/show_bug.cgi?id=179573
+
+        Reviewed by Darin Adler.
+
+        When we transitioned to the new URLParser, we kept the old character tables which were less spec-conformant.
+        Removing them and transitioning to URLParser's table makes more web platform tests pass!
+
+        * fileapi/BlobURL.cpp:
+        (WebCore::BlobURL::createBlobURL):
+        There's no need to percent-encode an origin.  It's already ascii, and if it's not, then the URLParser will escape it.
+        * loader/appcache/ApplicationCacheHost.cpp:
+        (WebCore::ApplicationCacheHost::createFileURL):
+        Removed comment that no longer applies.
+        * platform/URL.cpp:
+        (WebCore::URL::setProtocol):
+        (WebCore::percentEncodeCharacters):
+        (WebCore::URL::setUser):
+        (WebCore::URL::setPass):
+        Percent encode the userinfo character set from the URLParser according to https://url.spec.whatwg.org/#set-the-username and https://url.spec.whatwg.org/#set-the-password
+        (WebCore::URL::setPath):
+        A ? or a # are the only two characters that need to be pre-encoded when setting the path because they indicate the
+        beginning of a query or fragment.  All other characters will be encoded if necessary during parsing.
+        (WebCore::protocolIsInternal):
+        (): Deleted.
+        (WebCore::isSchemeFirstChar): Deleted.
+        (WebCore::isSchemeChar): Deleted.
+        (WebCore::isBadChar): Deleted.
+        (WebCore::isTabNewline): Deleted.
+        (WebCore::appendEscapedChar): Deleted.
+        (WebCore::encodeWithURLEscapeSequences):
+        Encode characters needed.  I used the user info set of characters because that was most similar to the BadChar set of the old parser.
+        This isn't standardized, and it's only used for the search context menu item which certainly isn't standardized.
+        (WebCore::isValidProtocol): Deleted.
+        Remove a bunch of old unused functions.
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::isInUserInfoEncodeSet):
+        (WebCore::URLParser::parseAuthority):
+        * platform/URLParser.h:
+        Expose a few functions for URL.cpp to use.
+
</ins><span class="cx"> 2017-11-14  Antti Koivisto  <antti@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Enable display:contents by default
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobURLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/BlobURL.cpp (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/BlobURL.cpp 2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebCore/fileapi/BlobURL.cpp    2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> URL BlobURL::createBlobURL(const String& originString)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!originString.isEmpty());
</span><del>-    String urlString = "blob:" + encodeWithURLEscapeSequences(originString) + '/' + createCanonicalUUIDString();
</del><ins>+    String urlString = "blob:" + originString + '/' + createCanonicalUUIDString();
</ins><span class="cx">     return URL(ParsedURLString, urlString);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderappcacheApplicationCacheHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp    2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheHost.cpp       2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -215,11 +215,6 @@
</span><span class="cx"> URL ApplicationCacheHost::createFileURL(const String& path)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Can we just use fileURLWithFileSystemPath instead?
</span><del>-
-    // fileURLWithFileSystemPath function is not suitable because URL::setPath uses encodeWithURLEscapeSequences, which it notes
-    // does not correctly escape '#' and '?'. This function works for our purposes because
-    // app cache media files are always created with encodeForFileName(createCanonicalUUIDString()).
-
</del><span class="cx"> #if USE(CF) && PLATFORM(WIN)
</span><span class="cx">     URL url(adoptCF(CFURLCreateWithFileSystemPath(0, path.createCFString().get(), kCFURLWindowsPathStyle, false)).get());
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URL.cpp (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URL.cpp    2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebCore/platform/URL.cpp       2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -55,276 +55,6 @@
</span><span class="cx"> 
</span><span class="cx"> static const unsigned invalidPortNumber = 0xFFFF;
</span><span class="cx"> 
</span><del>-enum URLCharacterClasses {
-    // alpha 
-    SchemeFirstChar = 1 << 0,
-
-    // ( alpha | digit | "+" | "-" | "." )
-    SchemeChar = 1 << 1,
-
-    // mark        = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
-    // unreserved  = alphanum | mark
-    // ( unreserved | escaped | ";" | ":" | "&" | "=" | "+" | "$" | "," )
-    UserInfoChar = 1 << 2,
-
-    // alnum | "." | "-" | "%"
-    // The above is what the specification says, but we are lenient to
-    // match existing practice and also allow:
-    // "_"
-    HostnameChar = 1 << 3,
-
-    // hexdigit | ":" | "%"
-    IPv6Char = 1 << 4,
-
-    // "#" | "?" | "/" | nul
-    PathSegmentEndChar = 1 << 5,
-
-    // not allowed in path
-    BadChar = 1 << 6,
-
-    // "\t" | "\n" | "\r"
-    TabNewline = 1 << 7
-};
-
-namespace URLInternal {
-static const unsigned char characterClassTable[256] = {
-    /* 0 nul */ PathSegmentEndChar,    /* 1 soh */ BadChar,
-    /* 2 stx */ BadChar,    /* 3 etx */ BadChar,
-    /* 4 eot */ BadChar,    /* 5 enq */ BadChar,    /* 6 ack */ BadChar,    /* 7 bel */ BadChar,
-    /* 8 bs */ BadChar,     /* 9 ht */ BadChar | TabNewline,                /* 10 nl */ BadChar | TabNewline,
-    /* 11 vt */ BadChar,    /* 12 np */ BadChar,    /* 13 cr */ BadChar | TabNewline,
-    /* 14 so */ BadChar,    /* 15 si */ BadChar,
-    /* 16 dle */ BadChar,   /* 17 dc1 */ BadChar,   /* 18 dc2 */ BadChar,   /* 19 dc3 */ BadChar,
-    /* 20 dc4 */ BadChar,   /* 21 nak */ BadChar,   /* 22 syn */ BadChar,   /* 23 etb */ BadChar,
-    /* 24 can */ BadChar,   /* 25 em */ BadChar,    /* 26 sub */ BadChar,   /* 27 esc */ BadChar,
-    /* 28 fs */ BadChar,    /* 29 gs */ BadChar,    /* 30 rs */ BadChar,    /* 31 us */ BadChar,
-    /* 32 sp */ BadChar,    /* 33  ! */ UserInfoChar,
-    /* 34  " */ BadChar,    /* 35  # */ PathSegmentEndChar | BadChar,
-    /* 36  $ */ UserInfoChar,    /* 37  % */ UserInfoChar | HostnameChar | IPv6Char | BadChar,
-    /* 38  & */ UserInfoChar,    /* 39  ' */ UserInfoChar,
-    /* 40  ( */ UserInfoChar,    /* 41  ) */ UserInfoChar,
-    /* 42  * */ UserInfoChar,    /* 43  + */ SchemeChar | UserInfoChar,
-    /* 44  , */ UserInfoChar,
-    /* 45  - */ SchemeChar | UserInfoChar | HostnameChar,
-    /* 46  . */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 47  / */ PathSegmentEndChar,
-    /* 48  0 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char, 
-    /* 49  1 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char,    
-    /* 50  2 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char, 
-    /* 51  3 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 52  4 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char, 
-    /* 53  5 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 54  6 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char, 
-    /* 55  7 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 56  8 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char, 
-    /* 57  9 */ SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 58  : */ UserInfoChar | IPv6Char,    /* 59  ; */ UserInfoChar,
-    /* 60  < */ BadChar,    /* 61  = */ UserInfoChar,
-    /* 62  > */ BadChar,    /* 63  ? */ PathSegmentEndChar | BadChar,
-    /* 64  @ */ 0,
-    /* 65  A */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,    
-    /* 66  B */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 67  C */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 68  D */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 69  E */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 70  F */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 71  G */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 72  H */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 73  I */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 74  J */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 75  K */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 76  L */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 77  M */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 78  N */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 79  O */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 80  P */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 81  Q */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 82  R */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 83  S */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 84  T */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 85  U */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 86  V */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 87  W */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 88  X */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 89  Y */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 90  Z */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 91  [ */ 0,
-    /* 92  \ */ 0,    /* 93  ] */ 0,
-    /* 94  ^ */ 0,
-    /* 95  _ */ UserInfoChar | HostnameChar,
-    /* 96  ` */ 0,
-    /* 97  a */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 98  b */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char, 
-    /* 99  c */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 100  d */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char, 
-    /* 101  e */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char,
-    /* 102  f */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | IPv6Char, 
-    /* 103  g */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 104  h */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 105  i */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 106  j */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 107  k */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 108  l */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 109  m */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 110  n */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 111  o */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 112  p */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 113  q */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 114  r */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 115  s */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 116  t */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 117  u */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 118  v */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 119  w */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 120  x */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 121  y */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 122  z */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 123  { */ 0,
-    /* 124  | */ 0,   /* 125  } */ 0,   /* 126  ~ */ UserInfoChar,   /* 127 del */ BadChar,
-    /* 128 */ BadChar, /* 129 */ BadChar, /* 130 */ BadChar, /* 131 */ BadChar,
-    /* 132 */ BadChar, /* 133 */ BadChar, /* 134 */ BadChar, /* 135 */ BadChar,
-    /* 136 */ BadChar, /* 137 */ BadChar, /* 138 */ BadChar, /* 139 */ BadChar,
-    /* 140 */ BadChar, /* 141 */ BadChar, /* 142 */ BadChar, /* 143 */ BadChar,
-    /* 144 */ BadChar, /* 145 */ BadChar, /* 146 */ BadChar, /* 147 */ BadChar,
-    /* 148 */ BadChar, /* 149 */ BadChar, /* 150 */ BadChar, /* 151 */ BadChar,
-    /* 152 */ BadChar, /* 153 */ BadChar, /* 154 */ BadChar, /* 155 */ BadChar,
-    /* 156 */ BadChar, /* 157 */ BadChar, /* 158 */ BadChar, /* 159 */ BadChar,
-    /* 160 */ BadChar, /* 161 */ BadChar, /* 162 */ BadChar, /* 163 */ BadChar,
-    /* 164 */ BadChar, /* 165 */ BadChar, /* 166 */ BadChar, /* 167 */ BadChar,
-    /* 168 */ BadChar, /* 169 */ BadChar, /* 170 */ BadChar, /* 171 */ BadChar,
-    /* 172 */ BadChar, /* 173 */ BadChar, /* 174 */ BadChar, /* 175 */ BadChar,
-    /* 176 */ BadChar, /* 177 */ BadChar, /* 178 */ BadChar, /* 179 */ BadChar,
-    /* 180 */ BadChar, /* 181 */ BadChar, /* 182 */ BadChar, /* 183 */ BadChar,
-    /* 184 */ BadChar, /* 185 */ BadChar, /* 186 */ BadChar, /* 187 */ BadChar,
-    /* 188 */ BadChar, /* 189 */ BadChar, /* 190 */ BadChar, /* 191 */ BadChar,
-    /* 192 */ BadChar, /* 193 */ BadChar, /* 194 */ BadChar, /* 195 */ BadChar,
-    /* 196 */ BadChar, /* 197 */ BadChar, /* 198 */ BadChar, /* 199 */ BadChar,
-    /* 200 */ BadChar, /* 201 */ BadChar, /* 202 */ BadChar, /* 203 */ BadChar,
-    /* 204 */ BadChar, /* 205 */ BadChar, /* 206 */ BadChar, /* 207 */ BadChar,
-    /* 208 */ BadChar, /* 209 */ BadChar, /* 210 */ BadChar, /* 211 */ BadChar,
-    /* 212 */ BadChar, /* 213 */ BadChar, /* 214 */ BadChar, /* 215 */ BadChar,
-    /* 216 */ BadChar, /* 217 */ BadChar, /* 218 */ BadChar, /* 219 */ BadChar,
-    /* 220 */ BadChar, /* 221 */ BadChar, /* 222 */ BadChar, /* 223 */ BadChar,
-    /* 224 */ BadChar, /* 225 */ BadChar, /* 226 */ BadChar, /* 227 */ BadChar,
-    /* 228 */ BadChar, /* 229 */ BadChar, /* 230 */ BadChar, /* 231 */ BadChar,
-    /* 232 */ BadChar, /* 233 */ BadChar, /* 234 */ BadChar, /* 235 */ BadChar,
-    /* 236 */ BadChar, /* 237 */ BadChar, /* 238 */ BadChar, /* 239 */ BadChar,
-    /* 240 */ BadChar, /* 241 */ BadChar, /* 242 */ BadChar, /* 243 */ BadChar,
-    /* 244 */ BadChar, /* 245 */ BadChar, /* 246 */ BadChar, /* 247 */ BadChar,
-    /* 248 */ BadChar, /* 249 */ BadChar, /* 250 */ BadChar, /* 251 */ BadChar,
-    /* 252 */ BadChar, /* 253 */ BadChar, /* 254 */ BadChar, /* 255 */ BadChar
-};
-}
-
-enum PercentEncodeCharacterClass {
-    // Class names match the URL Standard; each class is a superset of the previous one.
-    PercentEncodeSimple = 255,
-    PercentEncodeDefault = 127,
-    PercentEncodePassword = 63,
-    PercentEncodeUsername = 31,
-};
-
-static const unsigned char percentEncodeClassTable[256] = {
-    /* 0 nul */ PercentEncodeSimple,    /* 1 soh */ PercentEncodeSimple,    /* 2 stx */ PercentEncodeSimple,    /* 3 etx */ PercentEncodeSimple,
-    /* 4 eot */ PercentEncodeSimple,    /* 5 enq */ PercentEncodeSimple,    /* 6 ack */ PercentEncodeSimple,    /* 7 bel */ PercentEncodeSimple,
-    /* 8 bs */ PercentEncodeSimple,     /* 9 ht */ PercentEncodeSimple,     /* 10 nl */ PercentEncodeSimple,    /* 11 vt */ PercentEncodeSimple,
-    /* 12 np */ PercentEncodeSimple,    /* 13 cr */ PercentEncodeSimple,    /* 14 so */ PercentEncodeSimple,    /* 15 si */ PercentEncodeSimple,
-    /* 16 dle */ PercentEncodeSimple,   /* 17 dc1 */ PercentEncodeSimple,   /* 18 dc2 */ PercentEncodeSimple,   /* 19 dc3 */ PercentEncodeSimple,
-    /* 20 dc4 */ PercentEncodeSimple,   /* 21 nak */ PercentEncodeSimple,   /* 22 syn */ PercentEncodeSimple,   /* 23 etb */ PercentEncodeSimple,
-    /* 24 can */ PercentEncodeSimple,   /* 25 em */ PercentEncodeSimple,    /* 26 sub */ PercentEncodeSimple,   /* 27 esc */ PercentEncodeSimple,
-    /* 28 fs */ PercentEncodeSimple,    /* 29 gs */ PercentEncodeSimple,    /* 30 rs */ PercentEncodeSimple,    /* 31 us */ PercentEncodeSimple,
-    /* 32 sp */ PercentEncodeDefault,
-    /* 33  ! */ 0,
-    /* 34  " */ PercentEncodeDefault,
-    /* 35  # */ PercentEncodeDefault,
-    /* 36  $ */ 0,
-    /* 37  % */ 0,
-    /* 38  & */ 0,
-    /* 39  ' */ 0,
-    /* 40  ( */ 0,
-    /* 41  ) */ 0,
-    /* 42  * */ 0,
-    /* 43  + */ 0,
-    /* 44  , */ 0,
-    /* 45  - */ 0,
-    /* 46  . */ 0,
-    /* 47  / */ PercentEncodePassword,
-    /* 48  0 */ 0,    /* 49  1 */ 0,    /* 50  2 */ 0,    /* 51  3 */ 0,
-    /* 52  4 */ 0,    /* 53  5 */ 0,    /* 54  6 */ 0,    /* 55  7 */ 0,
-    /* 56  8 */ 0,    /* 57  9 */ 0,
-    /* 58  : */ PercentEncodeUsername,
-    /* 59  ; */ 0,
-    /* 60  < */ PercentEncodeDefault,
-    /* 61  = */ 0,
-    /* 62  > */ PercentEncodeDefault,
-    /* 63  ? */ PercentEncodeDefault,
-    /* 64  @ */ PercentEncodePassword,
-    /* 65  A */ 0,    /* 66  B */ 0,    /* 67  C */ 0,    /* 68  D */ 0,
-    /* 69  E */ 0,    /* 70  F */ 0,    /* 71  G */ 0,    /* 72  H */ 0,
-    /* 73  I */ 0,    /* 74  J */ 0,    /* 75  K */ 0,    /* 76  L */ 0,
-    /* 77  M */ 0,    /* 78  N */ 0,    /* 79  O */ 0,    /* 80  P */ 0,
-    /* 81  Q */ 0,    /* 82  R */ 0,    /* 83  S */ 0,    /* 84  T */ 0,
-    /* 85  U */ 0,    /* 86  V */ 0,    /* 87  W */ 0,    /* 88  X */ 0,
-    /* 89  Y */ 0,    /* 90  Z */ 0,
-    /* 91  [ */ 0,
-    /* 92  \ */ PercentEncodePassword,
-    /* 93  ] */ 0,
-    /* 94  ^ */ 0,
-    /* 95  _ */ 0,
-    /* 96  ` */ PercentEncodeDefault,
-    /* 97  a */ 0,    /* 98  b */ 0,    /* 99  c */ 0,    /* 100  d */ 0,
-    /* 101  e */ 0,    /* 102  f */ 0,    /* 103  g */ 0,    /* 104  h */ 0,
-    /* 105  i */ 0,    /* 106  j */ 0,    /* 107  k */ 0,    /* 108  l */ 0,
-    /* 109  m */ 0,    /* 110  n */ 0,    /* 111  o */ 0,    /* 112  p */ 0,
-    /* 113  q */ 0,    /* 114  r */ 0,    /* 115  s */ 0,    /* 116  t */ 0,
-    /* 117  u */ 0,    /* 118  v */ 0,    /* 119  w */ 0,    /* 120  x */ 0,
-    /* 121  y */ 0,    /* 122  z */ 0,
-    /* 123  { */ 0,
-    /* 124  | */ 0,
-    /* 125  } */ 0,
-    /* 126  ~ */ 0,
-    /* 127 del */ PercentEncodeSimple,
-    /* 128 */ PercentEncodeSimple, /* 129 */ PercentEncodeSimple, /* 130 */ PercentEncodeSimple, /* 131 */ PercentEncodeSimple,
-    /* 132 */ PercentEncodeSimple, /* 133 */ PercentEncodeSimple, /* 134 */ PercentEncodeSimple, /* 135 */ PercentEncodeSimple,
-    /* 136 */ PercentEncodeSimple, /* 137 */ PercentEncodeSimple, /* 138 */ PercentEncodeSimple, /* 139 */ PercentEncodeSimple,
-    /* 140 */ PercentEncodeSimple, /* 141 */ PercentEncodeSimple, /* 142 */ PercentEncodeSimple, /* 143 */ PercentEncodeSimple,
-    /* 144 */ PercentEncodeSimple, /* 145 */ PercentEncodeSimple, /* 146 */ PercentEncodeSimple, /* 147 */ PercentEncodeSimple,
-    /* 148 */ PercentEncodeSimple, /* 149 */ PercentEncodeSimple, /* 150 */ PercentEncodeSimple, /* 151 */ PercentEncodeSimple,
-    /* 152 */ PercentEncodeSimple, /* 153 */ PercentEncodeSimple, /* 154 */ PercentEncodeSimple, /* 155 */ PercentEncodeSimple,
-    /* 156 */ PercentEncodeSimple, /* 157 */ PercentEncodeSimple, /* 158 */ PercentEncodeSimple, /* 159 */ PercentEncodeSimple,
-    /* 160 */ PercentEncodeSimple, /* 161 */ PercentEncodeSimple, /* 162 */ PercentEncodeSimple, /* 163 */ PercentEncodeSimple,
-    /* 164 */ PercentEncodeSimple, /* 165 */ PercentEncodeSimple, /* 166 */ PercentEncodeSimple, /* 167 */ PercentEncodeSimple,
-    /* 168 */ PercentEncodeSimple, /* 169 */ PercentEncodeSimple, /* 170 */ PercentEncodeSimple, /* 171 */ PercentEncodeSimple,
-    /* 172 */ PercentEncodeSimple, /* 173 */ PercentEncodeSimple, /* 174 */ PercentEncodeSimple, /* 175 */ PercentEncodeSimple,
-    /* 176 */ PercentEncodeSimple, /* 177 */ PercentEncodeSimple, /* 178 */ PercentEncodeSimple, /* 179 */ PercentEncodeSimple,
-    /* 180 */ PercentEncodeSimple, /* 181 */ PercentEncodeSimple, /* 182 */ PercentEncodeSimple, /* 183 */ PercentEncodeSimple,
-    /* 184 */ PercentEncodeSimple, /* 185 */ PercentEncodeSimple, /* 186 */ PercentEncodeSimple, /* 187 */ PercentEncodeSimple,
-    /* 188 */ PercentEncodeSimple, /* 189 */ PercentEncodeSimple, /* 190 */ PercentEncodeSimple, /* 191 */ PercentEncodeSimple,
-    /* 192 */ PercentEncodeSimple, /* 193 */ PercentEncodeSimple, /* 194 */ PercentEncodeSimple, /* 195 */ PercentEncodeSimple,
-    /* 196 */ PercentEncodeSimple, /* 197 */ PercentEncodeSimple, /* 198 */ PercentEncodeSimple, /* 199 */ PercentEncodeSimple,
-    /* 200 */ PercentEncodeSimple, /* 201 */ PercentEncodeSimple, /* 202 */ PercentEncodeSimple, /* 203 */ PercentEncodeSimple,
-    /* 204 */ PercentEncodeSimple, /* 205 */ PercentEncodeSimple, /* 206 */ PercentEncodeSimple, /* 207 */ PercentEncodeSimple,
-    /* 208 */ PercentEncodeSimple, /* 209 */ PercentEncodeSimple, /* 210 */ PercentEncodeSimple, /* 211 */ PercentEncodeSimple,
-    /* 212 */ PercentEncodeSimple, /* 213 */ PercentEncodeSimple, /* 214 */ PercentEncodeSimple, /* 215 */ PercentEncodeSimple,
-    /* 216 */ PercentEncodeSimple, /* 217 */ PercentEncodeSimple, /* 218 */ PercentEncodeSimple, /* 219 */ PercentEncodeSimple,
-    /* 220 */ PercentEncodeSimple, /* 221 */ PercentEncodeSimple, /* 222 */ PercentEncodeSimple, /* 223 */ PercentEncodeSimple,
-    /* 224 */ PercentEncodeSimple, /* 225 */ PercentEncodeSimple, /* 226 */ PercentEncodeSimple, /* 227 */ PercentEncodeSimple,
-    /* 228 */ PercentEncodeSimple, /* 229 */ PercentEncodeSimple, /* 230 */ PercentEncodeSimple, /* 231 */ PercentEncodeSimple,
-    /* 232 */ PercentEncodeSimple, /* 233 */ PercentEncodeSimple, /* 234 */ PercentEncodeSimple, /* 235 */ PercentEncodeSimple,
-    /* 236 */ PercentEncodeSimple, /* 237 */ PercentEncodeSimple, /* 238 */ PercentEncodeSimple, /* 239 */ PercentEncodeSimple,
-    /* 240 */ PercentEncodeSimple, /* 241 */ PercentEncodeSimple, /* 242 */ PercentEncodeSimple, /* 243 */ PercentEncodeSimple,
-    /* 244 */ PercentEncodeSimple, /* 245 */ PercentEncodeSimple, /* 246 */ PercentEncodeSimple, /* 247 */ PercentEncodeSimple,
-    /* 248 */ PercentEncodeSimple, /* 249 */ PercentEncodeSimple, /* 250 */ PercentEncodeSimple, /* 251 */ PercentEncodeSimple,
-    /* 252 */ PercentEncodeSimple, /* 253 */ PercentEncodeSimple, /* 254 */ PercentEncodeSimple, /* 255 */ PercentEncodeSimple
-};
-
-static inline bool isSchemeFirstChar(UChar c) { return c <= 0xff && (URLInternal::characterClassTable[c] & SchemeFirstChar); }
-static inline bool isSchemeChar(UChar c) { return c <= 0xff && (URLInternal::characterClassTable[c] & SchemeChar); }
-static inline bool isBadChar(unsigned char c) { return URLInternal::characterClassTable[c] & BadChar; }
-static inline bool isTabNewline(UChar c) { return c <= 0xff && (URLInternal::characterClassTable[c] & TabNewline); }
-
-String encodeWithURLEscapeSequences(const String& notEncodedString, PercentEncodeCharacterClass whatToEncode);
-
</del><span class="cx"> // Copies the source to the destination, assuming all the source characters are
</span><span class="cx"> // ASCII. The destination buffer must be large enough. Null characters are allowed
</span><span class="cx"> // in the source string, and no attempt is made to null-terminate the result.
</span><span class="lines">@@ -651,17 +381,17 @@
</span><span class="cx">     // Firefox and IE remove everything after the first ':'.
</span><span class="cx">     size_t separatorPosition = s.find(':');
</span><span class="cx">     String newProtocol = s.substring(0, separatorPosition);
</span><del>-
-    if (!isValidProtocol(newProtocol))
</del><ins>+    auto canonicalized = URLParser::maybeCanonicalizeScheme(newProtocol);
+    if (!canonicalized)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!m_isValid) {
</span><del>-        URLParser parser(makeString(newProtocol, ":", m_string));
</del><ins>+        URLParser parser(makeString(*canonicalized, ":", m_string));
</ins><span class="cx">         *this = parser.result();
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    URLParser parser(makeString(newProtocol, m_string.substring(m_schemeEnd)));
</del><ins>+    URLParser parser(makeString(*canonicalized, m_string.substring(m_schemeEnd)));
</ins><span class="cx">     *this = parser.result();
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -795,6 +525,32 @@
</span><span class="cx">     *this = parser.result();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static String percentEncodeCharacters(const String& input, bool(*shouldEncode)(UChar))
+{
+    auto encode = [shouldEncode] (const String& input) {
+        CString utf8 = input.utf8();
+        auto* data = utf8.data();
+        StringBuilder builder;
+        auto length = utf8.length();
+        for (unsigned j = 0; j < length; j++) {
+            auto c = data[j];
+            if (shouldEncode(c)) {
+                builder.append('%');
+                builder.append(upperNibbleToASCIIHexDigit(c));
+                builder.append(lowerNibbleToASCIIHexDigit(c));
+            } else
+                builder.append(c);
+        }
+        return builder.toString();
+    };
+
+    for (size_t i = 0; i < input.length(); ++i) {
+        if (UNLIKELY(shouldEncode(input[i])))
+            return encode(input);
+    }
+    return input;
+}
+
</ins><span class="cx"> void URL::setUser(const String& user)
</span><span class="cx"> {
</span><span class="cx">     if (!m_isValid)
</span><span class="lines">@@ -805,13 +561,13 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned end = m_userEnd;
</span><span class="cx">     if (!user.isEmpty()) {
</span><del>-        String u = encodeWithURLEscapeSequences(user, PercentEncodeUsername);
</del><ins>+        String u = percentEncodeCharacters(user, URLParser::isInUserInfoEncodeSet);
</ins><span class="cx">         if (m_userStart == m_schemeEnd + 1)
</span><span class="cx">             u = "//" + u;
</span><span class="cx">         // Add '@' if we didn't have one before.
</span><span class="cx">         if (end == m_hostEnd || (end == m_passwordEnd && m_string[end] != '@'))
</span><span class="cx">             u.append('@');
</span><del>-        URLParser parser(makeString(m_string.left(m_userStart), u, m_string.substring(end)));
</del><ins>+        URLParser parser(makeString(StringView(m_string).left(m_userStart), u, StringView(m_string).substring(end)));
</ins><span class="cx">         *this = parser.result();
</span><span class="cx">     } else {
</span><span class="cx">         // Remove '@' if we now have neither user nor password.
</span><span class="lines">@@ -819,7 +575,7 @@
</span><span class="cx">             end += 1;
</span><span class="cx">         // We don't want to parse in the extremely common case where we are not going to make a change.
</span><span class="cx">         if (m_userStart != end) {
</span><del>-            URLParser parser(makeString(m_string.left(m_userStart), m_string.substring(end)));
</del><ins>+            URLParser parser(makeString(StringView(m_string).left(m_userStart), StringView(m_string).substring(end)));
</ins><span class="cx">             *this = parser.result();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -832,13 +588,13 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned end = m_passwordEnd;
</span><span class="cx">     if (!password.isEmpty()) {
</span><del>-        String p = ":" + encodeWithURLEscapeSequences(password, PercentEncodePassword) + "@";
</del><ins>+        String p = ":" + percentEncodeCharacters(password, URLParser::isInUserInfoEncodeSet) + "@";
</ins><span class="cx">         if (m_userEnd == m_schemeEnd + 1)
</span><span class="cx">             p = "//" + p;
</span><span class="cx">         // Eat the existing '@' since we are going to add our own.
</span><span class="cx">         if (end != m_hostEnd && m_string[end] == '@')
</span><span class="cx">             end += 1;
</span><del>-        URLParser parser(makeString(m_string.left(m_userEnd), p, m_string.substring(end)));
</del><ins>+        URLParser parser(makeString(StringView(m_string).left(m_userEnd), p, StringView(m_string).substring(end)));
</ins><span class="cx">         *this = parser.result();
</span><span class="cx">     } else {
</span><span class="cx">         // Remove '@' if we now have neither user nor password.
</span><span class="lines">@@ -846,7 +602,7 @@
</span><span class="cx">             end += 1;
</span><span class="cx">         // We don't want to parse in the extremely common case where we are not going to make a change.
</span><span class="cx">         if (m_userEnd != end) {
</span><del>-            URLParser parser(makeString(m_string.left(m_userEnd), m_string.substring(end)));
</del><ins>+            URLParser parser(makeString(StringView(m_string).left(m_userEnd), StringView(m_string).substring(end)));
</ins><span class="cx">             *this = parser.result();
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -891,10 +647,10 @@
</span><span class="cx">     // access to the document in this function.
</span><span class="cx">     // https://webkit.org/b/161176
</span><span class="cx">     if ((query.isEmpty() || query[0] != '?') && !query.isNull()) {
</span><del>-        URLParser parser(makeString(m_string.left(m_pathEnd), "?", query, m_string.substring(m_queryEnd)));
</del><ins>+        URLParser parser(makeString(StringView(m_string).left(m_pathEnd), "?", query, StringView(m_string).substring(m_queryEnd)));
</ins><span class="cx">         *this = parser.result();
</span><span class="cx">     } else {
</span><del>-        URLParser parser(makeString(m_string.left(m_pathEnd), query, m_string.substring(m_queryEnd)));
</del><ins>+        URLParser parser(makeString(StringView(m_string).left(m_pathEnd), query, StringView(m_string).substring(m_queryEnd)));
</ins><span class="cx">         *this = parser.result();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -905,13 +661,14 @@
</span><span class="cx">     if (!m_isValid)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    // FIXME: encodeWithURLEscapeSequences does not correctly escape '#' and '?', so fragment and query parts
-    // may be inadvertently affected.
</del><span class="cx">     String path = s;
</span><span class="cx">     if (path.isEmpty() || path[0] != '/')
</span><span class="cx">         path = "/" + path;
</span><span class="cx"> 
</span><del>-    URLParser parser(makeString(m_string.left(m_portEnd), encodeWithURLEscapeSequences(path), m_string.substring(m_pathEnd)));
</del><ins>+    auto questionMarkOrNumberSign = [] (UChar character) {
+        return character == '?' || character == '#';
+    };
+    URLParser parser(makeString(StringView(m_string).left(m_portEnd), percentEncodeCharacters(path, questionMarkOrNumberSign), StringView(m_string).substring(m_pathEnd)));
</ins><span class="cx">     *this = parser.result();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -925,13 +682,6 @@
</span><span class="cx">     return decodeEscapeSequences<URLEscapeSequence>(string, encoding);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Caution: This function does not bounds check.
-static void appendEscapedChar(char*& buffer, unsigned char c)
-{
-    *buffer++ = '%';
-    placeByteAsHex(c, buffer);
-}
-
</del><span class="cx"> String URL::serialize(bool omitFragment) const
</span><span class="cx"> {
</span><span class="cx">     if (omitFragment)
</span><span class="lines">@@ -1033,50 +783,11 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String encodeWithURLEscapeSequences(const String& notEncodedString, PercentEncodeCharacterClass whatToEncode)
</del><ins>+String encodeWithURLEscapeSequences(const String& input)
</ins><span class="cx"> {
</span><del>-    CString asUTF8 = notEncodedString.utf8();
-
-    CharBuffer buffer(asUTF8.length() * 3 + 1);
-    char* p = buffer.data();
-
-    const char* str = asUTF8.data();
-    const char* strEnd = str + asUTF8.length();
-    while (str < strEnd) {
-        unsigned char c = *str++;
-        if (percentEncodeClassTable[c] >= whatToEncode)
-            appendEscapedChar(p, c);
-        else
-            *p++ = c;
-    }
-
-    ASSERT(p - buffer.data() <= static_cast<int>(buffer.size()));
-
-    return String(buffer.data(), p - buffer.data());
</del><ins>+    return percentEncodeCharacters(input, URLParser::isInUserInfoEncodeSet);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-String encodeWithURLEscapeSequences(const String& notEncodedString)
-{
-    CString asUTF8 = notEncodedString.utf8();
-
-    CharBuffer buffer(asUTF8.length() * 3 + 1);
-    char* p = buffer.data();
-
-    const char* str = asUTF8.data();
-    const char* strEnd = str + asUTF8.length();
-    while (str < strEnd) {
-        unsigned char c = *str++;
-        if (isBadChar(c))
-            appendEscapedChar(p, c);
-        else
-            *p++ = c;
-    }
-
-    ASSERT(p - buffer.data() <= static_cast<int>(buffer.size()));
-
-    return String(buffer.data(), p - buffer.data());
-}
-
</del><span class="cx"> bool URL::isHierarchical() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_isValid)
</span><span class="lines">@@ -1106,7 +817,7 @@
</span><span class="cx">         isLeading = false;
</span><span class="cx"> 
</span><span class="cx">         // Skip any tabs and newlines.
</span><del>-        if (isTabNewline(url[i]))
</del><ins>+        if (url[i] == '\t' || url[i] == '\r' || url[i] == '\n')
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         if (!protocol[j])
</span><span class="lines">@@ -1130,21 +841,6 @@
</span><span class="cx">     return WebCore::protocolIsInternal(string, protocol);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool isValidProtocol(const String& protocol)
-{
-    // RFC3986: ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
-    if (protocol.isEmpty())
-        return false;
-    if (!isSchemeFirstChar(protocol[0]))
-        return false;
-    unsigned protocolLength = protocol.length();
-    for (unsigned i = 1; i < protocolLength; i++) {
-        if (!isSchemeChar(protocol[i]))
-            return false;
-    }
-    return true;
-}
-
</del><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> 
</span><span class="cx"> void URL::print() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.cpp (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.cpp      2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebCore/platform/URLParser.cpp 2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -429,6 +429,11 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool URLParser::isInUserInfoEncodeSet(UChar c)
+{
+    return WebCore::isInUserInfoEncodeSet(c);
+}
+
</ins><span class="cx"> template<typename CharacterType, URLParser::ReportSyntaxViolation reportSyntaxViolation>
</span><span class="cx"> ALWAYS_INLINE void URLParser::advance(CodePointIterator<CharacterType>& iterator, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
</span><span class="cx"> {
</span><span class="lines">@@ -2086,10 +2091,10 @@
</span><span class="cx">             appendToASCIIBuffer(':');
</span><span class="cx">             break;
</span><span class="cx">         }
</span><del>-        utf8PercentEncode<isInUserInfoEncodeSet>(iterator);
</del><ins>+        utf8PercentEncode<WebCore::isInUserInfoEncodeSet>(iterator);
</ins><span class="cx">     }
</span><span class="cx">     for (; !iterator.atEnd(); advance(iterator))
</span><del>-        utf8PercentEncode<isInUserInfoEncodeSet>(iterator);
</del><ins>+        utf8PercentEncode<WebCore::isInUserInfoEncodeSet>(iterator);
</ins><span class="cx">     m_url.m_passwordEnd = currentPosition(iterator);
</span><span class="cx">     if (!m_url.m_userEnd)
</span><span class="cx">         m_url.m_userEnd = m_url.m_passwordEnd;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.h (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.h        2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebCore/platform/URLParser.h   2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx">     static String serialize(const URLEncodedForm&);
</span><span class="cx"> 
</span><span class="cx">     static const UIDNA& internationalDomainNameTranscoder();
</span><ins>+    static bool isInUserInfoEncodeSet(UChar);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT static bool isSpecialScheme(const String& scheme);
</span><span class="cx">     WEBCORE_EXPORT static std::optional<String> maybeCanonicalizeScheme(const String& scheme);
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebKit/ChangeLog       2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-11-14  Alex Christensen  <achristensen@webkit.org>
+
+        Clean up old URL parser remnants
+        https://bugs.webkit.org/show_bug.cgi?id=179573
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
+        (WebKit::WebContextMenuClient::searchWithGoogle):
+        Use https if we do end up searching with google.
+
</ins><span class="cx"> 2017-11-14  Antti Koivisto  <antti@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Enable display:contents by default
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebContextMenuClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.cpp (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.cpp   2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.cpp      2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     String encoded = encodeWithURLEscapeSequences(searchString);
</span><span class="cx">     encoded.replace(ASCIILiteral { "%20" }, ASCIILiteral { "+" });
</span><span class="cx"> 
</span><del>-    String url = "http://www.google.com/search?q=" + encoded + "&ie=UTF-8&oe=UTF-8";
</del><ins>+    String url = "https://www.google.com/search?q=" + encoded + "&ie=UTF-8&oe=UTF-8";
</ins><span class="cx"> 
</span><span class="cx">     if (Page* page = frame->page()) {
</span><span class="cx">         UserGestureIndicator indicator(ProcessingUserGesture);
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/ChangeLog (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/ChangeLog  2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebKitLegacy/win/ChangeLog     2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-11-14  Alex Christensen  <achristensen@webkit.org>
+
+        Clean up old URL parser remnants
+        https://bugs.webkit.org/show_bug.cgi?id=179573
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebContextMenuClient.cpp:
+        (WebContextMenuClient::searchWithGoogle):
+        Use https if we do end up searching with google.
+
</ins><span class="cx"> 2017-11-12  Darin Adler  <darin@apple.com>
</span><span class="cx"> 
</span><span class="cx">         More is<> and downcast<>, less static_cast<>
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinWebCoreSupportWebContextMenuClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.cpp (224822 => 224823)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.cpp    2017-11-14 19:01:22 UTC (rev 224822)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.cpp       2017-11-14 19:15:23 UTC (rev 224823)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     String encoded = encodeWithURLEscapeSequences(searchString);
</span><span class="cx">     encoded.replace(ASCIILiteral { "%20" }, ASCIILiteral { "+" });
</span><span class="cx"> 
</span><del>-    String url = "http://www.google.com/search?q=" + encoded + "&ie=UTF-8&oe=UTF-8";
</del><ins>+    String url = "https://www.google.com/search?q=" + encoded + "&ie=UTF-8&oe=UTF-8";
</ins><span class="cx"> 
</span><span class="cx">     if (Page* page = frame->page()) {
</span><span class="cx">         UserGestureIndicator indicator(ProcessingUserGesture);
</span></span></pre>
</div>
</div>

</body>
</html>