<!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>[207152] 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/207152">207152</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-10-11 11:28:50 -0700 (Tue, 11 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>URLParser should percent-encode non-ASCII and non-printable characters in fragment
https://bugs.webkit.org/show_bug.cgi?id=163287

Reviewed by Brady Eidson.

Source/WebCore:

Based on discussion in https://github.com/whatwg/url/issues/150
If that discussion decides to keep the spec as-is (which keeps non-ASCII characters in the fragment
to match IE and Edge's behavior, which Chrome has followed for special schemes) then we can revert
this change later after enabling the URL parser.  Making this change keeps behavior matching Safari
and Firefox, as well as Chrome's handling of non-special schemes, such as data URLs.

Covered by updated API tests.

* platform/URLParser.cpp:
(WebCore::URLParser::appendToASCIIBuffer):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::syntaxViolation):
(WebCore::URLParser::currentPosition):
(WebCore::URLParser::parse):
(WebCore::URLParser::fragmentSyntaxViolation): Deleted.
* platform/URLParser.h:
No more non-ASCII characters in canonicalized URLs.

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):</pre>

<h3>Modified Paths</h3>
<ul>
<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>
<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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207151 => 207152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-11 18:20:23 UTC (rev 207151)
+++ trunk/Source/WebCore/ChangeLog        2016-10-11 18:28:50 UTC (rev 207152)
</span><span class="lines">@@ -1,5 +1,30 @@
</span><span class="cx"> 2016-10-11  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        URLParser should percent-encode non-ASCII and non-printable characters in fragment
+        https://bugs.webkit.org/show_bug.cgi?id=163287
+
+        Reviewed by Brady Eidson.
+
+        Based on discussion in https://github.com/whatwg/url/issues/150
+        If that discussion decides to keep the spec as-is (which keeps non-ASCII characters in the fragment
+        to match IE and Edge's behavior, which Chrome has followed for special schemes) then we can revert
+        this change later after enabling the URL parser.  Making this change keeps behavior matching Safari
+        and Firefox, as well as Chrome's handling of non-special schemes, such as data URLs.
+
+        Covered by updated API tests.
+
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::appendToASCIIBuffer):
+        (WebCore::URLParser::copyURLPartsUntil):
+        (WebCore::URLParser::syntaxViolation):
+        (WebCore::URLParser::currentPosition):
+        (WebCore::URLParser::parse):
+        (WebCore::URLParser::fragmentSyntaxViolation): Deleted.
+        * platform/URLParser.h:
+        No more non-ASCII characters in canonicalized URLs.
+
+2016-10-11  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
</ins><span class="cx">         Remove dead networking code
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=163263
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.cpp (207151 => 207152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.cpp        2016-10-11 18:20:23 UTC (rev 207151)
+++ trunk/Source/WebCore/platform/URLParser.cpp        2016-10-11 18:28:50 UTC (rev 207152)
</span><span class="lines">@@ -462,7 +462,6 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE void URLParser::appendToASCIIBuffer(UChar32 codePoint)
</span><span class="cx"> {
</span><del>-    ASSERT(m_unicodeFragmentBuffer.isEmpty());
</del><span class="cx">     ASSERT(isASCII(codePoint));
</span><span class="cx">     if (UNLIKELY(m_didSeeSyntaxViolation))
</span><span class="cx">         m_asciiBuffer.append(codePoint);
</span><span class="lines">@@ -470,7 +469,6 @@
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE void URLParser::appendToASCIIBuffer(const char* characters, size_t length)
</span><span class="cx"> {
</span><del>-    ASSERT(m_unicodeFragmentBuffer.isEmpty());
</del><span class="cx">     if (UNLIKELY(m_didSeeSyntaxViolation))
</span><span class="cx">         m_asciiBuffer.append(characters, length);
</span><span class="cx"> }
</span><span class="lines">@@ -829,7 +827,6 @@
</span><span class="cx">     syntaxViolation(iterator);
</span><span class="cx"> 
</span><span class="cx">     m_asciiBuffer.clear();
</span><del>-    m_unicodeFragmentBuffer.clear();
</del><span class="cx">     copyASCIIStringUntil(base.m_string, urlLengthUntilPart(base, part));
</span><span class="cx">     switch (part) {
</span><span class="cx">     case URLPart::FragmentEnd:
</span><span class="lines">@@ -1018,7 +1015,6 @@
</span><span class="cx">     m_didSeeSyntaxViolation = true;
</span><span class="cx">     
</span><span class="cx">     ASSERT(m_asciiBuffer.isEmpty());
</span><del>-    ASSERT(m_unicodeFragmentBuffer.isEmpty());
</del><span class="cx">     size_t codeUnitsToCopy = iterator.codeUnitsSince(reinterpret_cast&lt;const CharacterType*&gt;(m_inputBegin));
</span><span class="cx">     RELEASE_ASSERT(codeUnitsToCopy &lt;= m_inputString.length());
</span><span class="cx">     m_asciiBuffer.reserveCapacity(m_inputString.length());
</span><span class="lines">@@ -1028,30 +1024,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename CharacterType&gt;
-void URLParser::fragmentSyntaxViolation(const CodePointIterator&lt;CharacterType&gt;&amp; iterator)
-{
-    ASSERT(m_didSeeUnicodeFragmentCodePoint);
-    if (m_didSeeSyntaxViolation)
-        return;
-    m_didSeeSyntaxViolation = true;
-
-    ASSERT(m_asciiBuffer.isEmpty());
-    ASSERT(m_unicodeFragmentBuffer.isEmpty());
-    size_t codeUnitsToCopy = iterator.codeUnitsSince(reinterpret_cast&lt;const CharacterType*&gt;(m_inputBegin));
-    size_t asciiCodeUnitsToCopy = m_url.m_queryEnd;
-    size_t unicodeCodeUnitsToCopy = codeUnitsToCopy - asciiCodeUnitsToCopy;
-    RELEASE_ASSERT(codeUnitsToCopy &lt;= m_inputString.length());
-    m_asciiBuffer.reserveCapacity(asciiCodeUnitsToCopy);
-    for (size_t i = 0; i &lt; asciiCodeUnitsToCopy; ++i) {
-        ASSERT(isASCII(m_inputString[i]));
-        m_asciiBuffer.uncheckedAppend(m_inputString[i]);
-    }
-    m_unicodeFragmentBuffer.reserveCapacity(m_inputString.length() - asciiCodeUnitsToCopy);
-    for (size_t i = asciiCodeUnitsToCopy; i &lt; asciiCodeUnitsToCopy + unicodeCodeUnitsToCopy; ++i)
-        m_unicodeFragmentBuffer.uncheckedAppend(m_inputString[i]);
-}
-
</del><span class="cx"> void URLParser::failure()
</span><span class="cx"> {
</span><span class="cx">     m_url.invalidate();
</span><span class="lines">@@ -1111,10 +1083,8 @@
</span><span class="cx"> template&lt;typename CharacterType&gt;
</span><span class="cx"> ALWAYS_INLINE size_t URLParser::currentPosition(const CodePointIterator&lt;CharacterType&gt;&amp; iterator)
</span><span class="cx"> {
</span><del>-    if (UNLIKELY(m_didSeeSyntaxViolation)) {
-        ASSERT(m_unicodeFragmentBuffer.isEmpty());
</del><ins>+    if (UNLIKELY(m_didSeeSyntaxViolation))
</ins><span class="cx">         return m_asciiBuffer.size();
</span><del>-    }
</del><span class="cx">     
</span><span class="cx">     return iterator.codeUnitsSince(reinterpret_cast&lt;const CharacterType*&gt;(m_inputBegin));
</span><span class="cx"> }
</span><span class="lines">@@ -1160,7 +1130,6 @@
</span><span class="cx">     URL_PARSER_LOG(&quot;Parsing URL &lt;%s&gt; base &lt;%s&gt; encoding &lt;%s&gt;&quot;, String(input, length).utf8().data(), base.string().utf8().data(), encoding.name());
</span><span class="cx">     m_url = { };
</span><span class="cx">     ASSERT(m_asciiBuffer.isEmpty());
</span><del>-    ASSERT(m_unicodeFragmentBuffer.isEmpty());
</del><span class="cx">     
</span><span class="cx">     bool isUTF8Encoding = encoding == UTF8Encoding();
</span><span class="cx">     Vector&lt;UChar&gt; queryBuffer;
</span><span class="lines">@@ -1811,35 +1780,9 @@
</span><span class="cx">             } while (!c.atEnd());
</span><span class="cx">             break;
</span><span class="cx">         case State::Fragment:
</span><del>-            do {
-                URL_PARSER_LOG(&quot;State Fragment&quot;);
-                if (!c.atEnd() &amp;&amp; isTabOrNewline(*c)) {
-                    if (m_didSeeUnicodeFragmentCodePoint)
-                        fragmentSyntaxViolation(c);
-                    else
-                        syntaxViolation(c);
-                    ++c;
-                    continue;
-                }
-                if (!m_didSeeUnicodeFragmentCodePoint &amp;&amp; isASCII(*c)) {
-                    if (m_urlIsSpecial)
-                        appendToASCIIBuffer(*c);
-                    else
-                        utf8PercentEncode&lt;isInSimpleEncodeSet&gt;(c);
-                } else {
-                    if (m_urlIsSpecial) {
-                        m_didSeeUnicodeFragmentCodePoint = true;
-                        if (UNLIKELY(m_didSeeSyntaxViolation))
-                            appendCodePoint(m_unicodeFragmentBuffer, *c);
-                        else {
-                            ASSERT(m_asciiBuffer.isEmpty());
-                            ASSERT(m_unicodeFragmentBuffer.isEmpty());
-                        }
-                    } else
-                        utf8PercentEncode&lt;isInSimpleEncodeSet&gt;(c);
-                }
-                ++c;
-            } while (!c.atEnd());
</del><ins>+            URL_PARSER_LOG(&quot;State Fragment&quot;);
+            utf8PercentEncode&lt;isInSimpleEncodeSet&gt;(c);
+            ++c;
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -2043,28 +1986,16 @@
</span><span class="cx">         m_url.m_fragmentEnd = m_url.m_queryEnd;
</span><span class="cx">         break;
</span><span class="cx">     case State::Fragment:
</span><del>-        {
-            LOG_FINAL_STATE(&quot;Fragment&quot;);
-            size_t length = m_didSeeSyntaxViolation ? m_asciiBuffer.size() + m_unicodeFragmentBuffer.size() : c.codeUnitsSince(reinterpret_cast&lt;const CharacterType*&gt;(m_inputBegin));
-            m_url.m_fragmentEnd = length;
-            break;
-        }
</del><ins>+        LOG_FINAL_STATE(&quot;Fragment&quot;);
+        m_url.m_fragmentEnd = currentPosition(c);
+        break;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (LIKELY(!m_didSeeSyntaxViolation)) {
</span><span class="cx">         m_url.m_string = m_inputString;
</span><span class="cx">         ASSERT(m_asciiBuffer.isEmpty());
</span><del>-        ASSERT(m_unicodeFragmentBuffer.isEmpty());
-    } else if (!m_didSeeUnicodeFragmentCodePoint) {
-        ASSERT(m_unicodeFragmentBuffer.isEmpty());
</del><ins>+    } else
</ins><span class="cx">         m_url.m_string = String::adopt(WTFMove(m_asciiBuffer));
</span><del>-    } else {
-        Vector&lt;UChar&gt; buffer;
-        buffer.reserveInitialCapacity(m_asciiBuffer.size() + m_unicodeFragmentBuffer.size());
-        buffer.appendVector(m_asciiBuffer);
-        buffer.appendVector(m_unicodeFragmentBuffer);
-        m_url.m_string = String::adopt(WTFMove(buffer));
-    }
</del><span class="cx">     m_url.m_isValid = true;
</span><span class="cx">     URL_PARSER_LOG(&quot;Parsed URL &lt;%s&gt;&quot;, m_url.m_string.utf8().data());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.h (207151 => 207152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.h        2016-10-11 18:20:23 UTC (rev 207151)
+++ trunk/Source/WebCore/platform/URLParser.h        2016-10-11 18:28:50 UTC (rev 207152)
</span><span class="lines">@@ -51,8 +51,6 @@
</span><span class="cx"> private:
</span><span class="cx">     URL m_url;
</span><span class="cx">     Vector&lt;LChar&gt; m_asciiBuffer;
</span><del>-    Vector&lt;UChar&gt; m_unicodeFragmentBuffer;
-    bool m_didSeeUnicodeFragmentCodePoint { false };
</del><span class="cx">     bool m_urlIsSpecial { false };
</span><span class="cx">     bool m_hostHasPercentOrNonASCII { false };
</span><span class="cx">     String m_inputString;
</span><span class="lines">@@ -73,7 +71,6 @@
</span><span class="cx">     void advance(CodePointIterator&lt;CharacterType&gt;&amp;, const CodePointIterator&lt;CharacterType&gt;&amp; iteratorForSyntaxViolationPosition);
</span><span class="cx">     template&lt;typename CharacterType&gt; bool takesTwoAdvancesUntilEnd(CodePointIterator&lt;CharacterType&gt;);
</span><span class="cx">     template&lt;typename CharacterType&gt; void syntaxViolation(const CodePointIterator&lt;CharacterType&gt;&amp;);
</span><del>-    template&lt;typename CharacterType&gt; void fragmentSyntaxViolation(const CodePointIterator&lt;CharacterType&gt;&amp;);
</del><span class="cx">     template&lt;typename CharacterType&gt; bool isPercentEncodedDot(CodePointIterator&lt;CharacterType&gt;);
</span><span class="cx">     template&lt;typename CharacterType&gt; bool isWindowsDriveLetter(CodePointIterator&lt;CharacterType&gt;);
</span><span class="cx">     template&lt;typename CharacterType&gt; bool isSingleDotPathSegment(CodePointIterator&lt;CharacterType&gt;);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (207151 => 207152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-10-11 18:20:23 UTC (rev 207151)
+++ trunk/Tools/ChangeLog        2016-10-11 18:28:50 UTC (rev 207152)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2016-10-11  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><ins>+        URLParser should percent-encode non-ASCII and non-printable characters in fragment
+        https://bugs.webkit.org/show_bug.cgi?id=163287
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+        (TestWebKitAPI::TEST_F):
+
+2016-10-11  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
</ins><span class="cx">         Remove dead networking code
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=163263
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (207151 => 207152)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp        2016-10-11 18:20:23 UTC (rev 207151)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp        2016-10-11 18:28:50 UTC (rev 207152)
</span><span class="lines">@@ -331,6 +331,10 @@
</span><span class="cx">     checkURL(&quot;aA://&quot;, {&quot;aa&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, 0, &quot;//&quot;, &quot;&quot;, &quot;&quot;, &quot;aa://&quot;});
</span><span class="cx">     checkURL(utf16String(u&quot;foo://host/#ŠŸŠŸ\u0007 a&lt;/&quot;), {&quot;foo&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;%D0%9F%D0%9F%07 a&lt;/&quot;, &quot;foo://host/#%D0%9F%D0%9F%07 a&lt;/&quot;});
</span><span class="cx">     checkURL(utf16String(u&quot;foo://host/#\u0007 a&lt;/&quot;), {&quot;foo&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;%07 a&lt;/&quot;, &quot;foo://host/#%07 a&lt;/&quot;});
</span><ins>+    checkURL(utf16String(u&quot;http://host?ƟšŸ˜#ƟšŸ˜&quot;), {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, &quot;http://host/?%C3%9F%F0%9F%98%8D#%C3%9F%F0%9F%98%8D&quot;}, testTabsValueForSurrogatePairs);
+    checkURL(utf16String(u&quot;http://host/path#šŸ’©\tšŸ’©&quot;), {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/path&quot;, &quot;&quot;, &quot;%F0%9F%92%A9%F0%9F%92%A9&quot;, &quot;http://host/path#%F0%9F%92%A9%F0%9F%92%A9&quot;}, testTabsValueForSurrogatePairs);
+    checkURL(utf16String(u&quot;http://host/#ŠŸŠŸ\u0007 a&lt;/&quot;), {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;%D0%9F%D0%9F%07 a&lt;/&quot;, &quot;http://host/#%D0%9F%D0%9F%07 a&lt;/&quot;});
+    checkURL(utf16String(u&quot;http://host/#\u0007 a&lt;/&quot;), {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;%07 a&lt;/&quot;, &quot;http://host/#%07 a&lt;/&quot;});
</ins><span class="cx"> 
</span><span class="cx">     // This disagrees with the web platform test for http://:@www.example.com but agrees with Chrome and URL::parse,
</span><span class="cx">     // and Firefox fails the web platform test differently. Maybe the web platform test ought to be changed.
</span><span class="lines">@@ -456,6 +460,7 @@
</span><span class="cx">     checkRelativeURL(&quot;  &quot;, &quot;http://host/path?query#fra#gment&quot;, {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/path&quot;, &quot;query&quot;, &quot;&quot;, &quot;http://host/path?query&quot;});
</span><span class="cx">     checkRelativeURL(&quot; \a &quot;, &quot;http://host/#fragment&quot;, {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;&quot;, &quot;http://host/&quot;});
</span><span class="cx">     checkRelativeURL(&quot;foo://&quot;, &quot;http://example.org/foo/bar&quot;, {&quot;foo&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, 0, &quot;//&quot;, &quot;&quot;, &quot;&quot;, &quot;foo://&quot;});
</span><ins>+    checkRelativeURL(utf16String(u&quot;#Ī²&quot;), &quot;http://example.org/foo/bar&quot;, {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;example.org&quot;, 0, &quot;/foo/bar&quot;, &quot;&quot;, &quot;%CE%B2&quot;, &quot;http://example.org/foo/bar#%CE%B2&quot;});
</ins><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="cx">     // but it is included in the web platform tests.
</span><span class="lines">@@ -630,9 +635,6 @@
</span><span class="cx">     checkURLDifferences(&quot;file://[0:a:0:0:b:c:0:0]/path&quot;,
</span><span class="cx">         {&quot;file&quot;, &quot;&quot;, &quot;&quot;, &quot;[0:a::b:c:0:0]&quot;, 0, &quot;/path&quot;, &quot;&quot;, &quot;&quot;, &quot;file://[0:a::b:c:0:0]/path&quot;},
</span><span class="cx">         {&quot;file&quot;, &quot;&quot;, &quot;&quot;, &quot;[0:a:0:0:b:c:0:0]&quot;, 0, &quot;/path&quot;, &quot;&quot;, &quot;&quot;, &quot;file://[0:a:0:0:b:c:0:0]/path&quot;});
</span><del>-    checkRelativeURLDifferences(utf16String(u&quot;#Ī²&quot;), &quot;http://example.org/foo/bar&quot;,
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;example.org&quot;, 0, &quot;/foo/bar&quot;, &quot;&quot;, utf16String(u&quot;Ī²&quot;), utf16String(u&quot;http://example.org/foo/bar#Ī²&quot;)},
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;example.org&quot;, 0, &quot;/foo/bar&quot;, &quot;&quot;, &quot;%CE%B2&quot;, &quot;http://example.org/foo/bar#%CE%B2&quot;});
</del><span class="cx">     checkURLDifferences(&quot;http://&quot;,
</span><span class="cx">         {&quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, 0, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;http://&quot;},
</span><span class="cx">         {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;&quot;, &quot;http:/&quot;});
</span><span class="lines">@@ -769,12 +771,6 @@
</span><span class="cx">     checkURLDifferences(&quot;notspecial://@test@test@example:800\\path@end&quot;,
</span><span class="cx">         {&quot;notspecial&quot;, &quot;@test@test@example&quot;, &quot;800\\path&quot;, &quot;end&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;&quot;, &quot;notspecial://%40test%40test%40example:800%5Cpath@end/&quot;},
</span><span class="cx">         {&quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, 0, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;notspecial://@test@test@example:800\\path@end&quot;});
</span><del>-    checkURLDifferences(utf16String(u&quot;http://host?ƟšŸ˜#ƟšŸ˜&quot;),
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, utf16String(u&quot;ƟšŸ˜&quot;), utf16String(u&quot;http://host/?%C3%9F%F0%9F%98%8D#ƟšŸ˜&quot;)},
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, &quot;http://host/?%C3%9F%F0%9F%98%8D#%C3%9F%F0%9F%98%8D&quot;}, testTabsValueForSurrogatePairs);
-    checkURLDifferences(utf16String(u&quot;http://host/path#šŸ’©\tšŸ’©&quot;),
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/path&quot;, &quot;&quot;, utf16String(u&quot;šŸ’©šŸ’©&quot;), utf16String(u&quot;http://host/path#šŸ’©šŸ’©&quot;)},
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/path&quot;, &quot;&quot;, &quot;%F0%9F%92%A9%F0%9F%92%A9&quot;, &quot;http://host/path#%F0%9F%92%A9%F0%9F%92%A9&quot;});
</del><span class="cx">     checkURLDifferences(&quot;http://%48OsT&quot;,
</span><span class="cx">         {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;&quot;, &quot;http://host/&quot;},
</span><span class="cx">         {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;%48ost&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;&quot;, &quot;http://%48ost/&quot;});
</span><span class="lines">@@ -1060,12 +1056,6 @@
</span><span class="cx">     checkURLDifferences(&quot;file://:0/path&quot;,
</span><span class="cx">         {&quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, 0, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;file://:0/path&quot;},
</span><span class="cx">         {&quot;file&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, 0, &quot;/path&quot;, &quot;&quot;, &quot;&quot;, &quot;file://:0/path&quot;});
</span><del>-    checkURLDifferences(utf16String(u&quot;http://host/#ŠŸŠŸ\u0007 a&lt;/&quot;),
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, utf16String(u&quot;ŠŸŠŸ\u0007 a&lt;/&quot;), utf16String(u&quot;http://host/#ŠŸŠŸ\u0007 a&lt;/&quot;)},
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;%D0%9F%D0%9F%07 a&lt;/&quot;, &quot;http://host/#%D0%9F%D0%9F%07 a&lt;/&quot;});
-    checkURLDifferences(utf16String(u&quot;http://host/#\u0007 a&lt;/&quot;),
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;\a a&lt;/&quot;, &quot;http://host/#\a a&lt;/&quot;},
-        {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;&quot;, &quot;%07 a&lt;/&quot;, &quot;http://host/#%07 a&lt;/&quot;});
</del><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> static void shouldFail(const String&amp; urlString)
</span><span class="lines">@@ -1224,8 +1214,7 @@
</span><span class="cx"> 
</span><span class="cx"> TEST_F(URLParserTest, QueryEncoding)
</span><span class="cx"> {
</span><del>-    checkURL(utf16String(u&quot;http://host?ƟšŸ˜#ƟšŸ˜&quot;), UTF8Encoding(), {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, utf16String(u&quot;ƟšŸ˜&quot;), utf16String(u&quot;http://host/?%C3%9F%F0%9F%98%8D#ƟšŸ˜&quot;)}, testTabsValueForSurrogatePairs);
-    checkURL(utf16String(u&quot;http://host?ƟšŸ˜#ƟšŸ˜&quot;), UTF8Encoding(), {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, utf16String(u&quot;ƟšŸ˜&quot;), utf16String(u&quot;http://host/?%C3%9F%F0%9F%98%8D#ƟšŸ˜&quot;)}, testTabsValueForSurrogatePairs);
</del><ins>+    checkURL(utf16String(u&quot;http://host?ƟšŸ˜#ƟšŸ˜&quot;), UTF8Encoding(), {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, &quot;%C3%9F%F0%9F%98%8D&quot;, utf16String(u&quot;http://host/?%C3%9F%F0%9F%98%8D#%C3%9F%F0%9F%98%8D&quot;)}, testTabsValueForSurrogatePairs);
</ins><span class="cx"> 
</span><span class="cx">     TextEncoding latin1(String(&quot;latin1&quot;));
</span><span class="cx">     checkURL(&quot;http://host/?query with%20spaces&quot;, latin1, {&quot;http&quot;, &quot;&quot;, &quot;&quot;, &quot;host&quot;, 0, &quot;/&quot;, &quot;query%20with%20spaces&quot;, &quot;&quot;, &quot;http://host/?query%20with%20spaces&quot;});
</span></span></pre>
</div>
</div>

</body>
</html>