<!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>[206648] 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/206648">206648</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-09-30 11:46:28 -0700 (Fri, 30 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>URLParser: handle syntax violations in non-UTF-8 encoded queries
https://bugs.webkit.org/show_bug.cgi?id=162770
Reviewed by Tim Horton.
Source/WebCore:
There is a fast path for queries of URLs that use UTF-8 encoding, which are quite common.
For non-UTF-8 encoded queries, which are less common, we put the code points in a Vector<UChar>
and encode them all at once. If there is a syntax violation in the query, we need to copy the
syntax-violation-free string up to the beginning of the query, then encode the query.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::percentEncodeByte):
(WebCore::URLParser::encodeQuery):
(WebCore::URLParser::parse):
* platform/URLParser.h:
Tools:
* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::checkURL):
(TestWebKitAPI::TEST_F):
Tests with emoji change behavior when we insert a tab between the surrogates, so don't do the
insert-tab-at-each-location verification that syntax violations are handled correctly.</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 (206647 => 206648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-30 18:44:16 UTC (rev 206647)
+++ trunk/Source/WebCore/ChangeLog        2016-09-30 18:46:28 UTC (rev 206648)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-09-30 Alex Christensen <achristensen@webkit.org>
+
+ URLParser: handle syntax violations in non-UTF-8 encoded queries
+ https://bugs.webkit.org/show_bug.cgi?id=162770
+
+ Reviewed by Tim Horton.
+
+ There is a fast path for queries of URLs that use UTF-8 encoding, which are quite common.
+ For non-UTF-8 encoded queries, which are less common, we put the code points in a Vector<UChar>
+ and encode them all at once. If there is a syntax violation in the query, we need to copy the
+ syntax-violation-free string up to the beginning of the query, then encode the query.
+
+ Covered by new API tests.
+
+ * platform/URLParser.cpp:
+ (WebCore::URLParser::percentEncodeByte):
+ (WebCore::URLParser::encodeQuery):
+ (WebCore::URLParser::parse):
+ * platform/URLParser.h:
+
</ins><span class="cx"> 2016-09-27 Anders Carlsson <andersca@apple.com>
</span><span class="cx">
</span><span class="cx"> Remove a couple of unused members from PlatformKeyboardEvent
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.cpp (206647 => 206648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.cpp        2016-09-30 18:44:16 UTC (rev 206647)
+++ trunk/Source/WebCore/platform/URLParser.cpp        2016-09-30 18:46:28 UTC (rev 206648)
</span><span class="lines">@@ -494,6 +494,7 @@
</span><span class="cx">
</span><span class="cx"> void URLParser::percentEncodeByte(uint8_t byte)
</span><span class="cx"> {
</span><ins>+ ASSERT(m_didSeeSyntaxViolation);
</ins><span class="cx"> appendToASCIIBuffer('%');
</span><span class="cx"> appendToASCIIBuffer(upperNibbleToASCIIHexDigit(byte));
</span><span class="cx"> appendToASCIIBuffer(lowerNibbleToASCIIHexDigit(byte));
</span><span class="lines">@@ -562,15 +563,39 @@
</span><span class="cx"> appendToASCIIBuffer(byte);
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>-
-void URLParser::encodeQuery(const Vector<UChar>& source, const TextEncoding& encoding)
</del><ins>+
+template<typename CharacterType>
+void URLParser::encodeQuery(const Vector<UChar>& source, const TextEncoding& encoding, CodePointIterator<CharacterType> iterator)
</ins><span class="cx"> {
</span><span class="cx"> // FIXME: It is unclear in the spec what to do when encoding fails. The behavior should be specified and tested.
</span><span class="cx"> CString encoded = encoding.encode(StringView(source.data(), source.size()), URLEncodedEntitiesForUnencodables);
</span><span class="cx"> const char* data = encoded.data();
</span><span class="cx"> size_t length = encoded.length();
</span><del>- for (size_t i = 0; i < length; ++i) {
</del><ins>+
+ if (!length == !iterator.atEnd()) {
+ syntaxViolation(iterator);
+ return;
+ }
+
+ size_t i = 0;
+ for (; i < length; ++i) {
+ ASSERT(!iterator.atEnd());
</ins><span class="cx"> uint8_t byte = data[i];
</span><ins>+ if (UNLIKELY(byte != *iterator)) {
+ syntaxViolation(iterator);
+ break;
+ }
+ if (UNLIKELY(shouldPercentEncodeQueryByte(byte))) {
+ syntaxViolation(iterator);
+ break;
+ }
+ appendToASCIIBuffer(byte);
+ ++iterator;
+ }
+ ASSERT((i == length) == iterator.atEnd());
+ for (; i < length; ++i) {
+ ASSERT(m_didSeeSyntaxViolation);
+ uint8_t byte = data[i];
</ins><span class="cx"> if (shouldPercentEncodeQueryByte(byte))
</span><span class="cx"> percentEncodeByte(byte);
</span><span class="cx"> else
</span><span class="lines">@@ -1103,6 +1128,7 @@
</span><span class="cx"> }
</span><span class="cx"> CodePointIterator<CharacterType> c(input, input + endIndex);
</span><span class="cx"> CodePointIterator<CharacterType> authorityOrHostBegin;
</span><ins>+ CodePointIterator<CharacterType> queryBegin;
</ins><span class="cx"> while (UNLIKELY(!c.atEnd() && isC0ControlOrSpace(*c))) {
</span><span class="cx"> syntaxViolation(c);
</span><span class="cx"> ++c;
</span><span class="lines">@@ -1127,7 +1153,8 @@
</span><span class="cx"> PathStart,
</span><span class="cx"> Path,
</span><span class="cx"> CannotBeABaseURLPath,
</span><del>- Query,
</del><ins>+ UTF8Query,
+ NonUTF8Query,
</ins><span class="cx"> Fragment,
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -1288,8 +1315,13 @@
</span><span class="cx"> case '?':
</span><span class="cx"> copyURLPartsUntil(base, URLPart::PathEnd, c);
</span><span class="cx"> appendToASCIIBuffer('?');
</span><del>- state = State::Query;
</del><span class="cx"> ++c;
</span><ins>+ if (isUTF8Encoding)
+ state = State::UTF8Query;
+ else {
+ queryBegin = c;
+ state = State::NonUTF8Query;
+ }
</ins><span class="cx"> break;
</span><span class="cx"> case '#':
</span><span class="cx"> copyURLPartsUntil(base, URLPart::QueryEnd, c);
</span><span class="lines">@@ -1431,6 +1463,13 @@
</span><span class="cx"> if (base.isValid() && base.protocolIs("file"))
</span><span class="cx"> copyURLPartsUntil(base, URLPart::PathEnd, c);
</span><span class="cx"> appendToASCIIBuffer("///?", 4);
</span><ins>+ ++c;
+ if (isUTF8Encoding)
+ state = State::UTF8Query;
+ else {
+ queryBegin = c;
+ state = State::NonUTF8Query;
+ }
</ins><span class="cx"> m_url.m_userStart = currentPosition(c) - 2;
</span><span class="cx"> m_url.m_userEnd = m_url.m_userStart;
</span><span class="cx"> m_url.m_passwordEnd = m_url.m_userStart;
</span><span class="lines">@@ -1438,8 +1477,6 @@
</span><span class="cx"> m_url.m_portEnd = m_url.m_userStart;
</span><span class="cx"> m_url.m_pathAfterLastSlash = m_url.m_userStart + 1;
</span><span class="cx"> m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
</span><del>- state = State::Query;
- ++c;
</del><span class="cx"> break;
</span><span class="cx"> case '#':
</span><span class="cx"> syntaxViolation(c);
</span><span class="lines">@@ -1533,9 +1570,14 @@
</span><span class="cx"> syntaxViolation(c);
</span><span class="cx"> appendToASCIIBuffer("/?", 2);
</span><span class="cx"> ++c;
</span><ins>+ if (isUTF8Encoding)
+ state = State::UTF8Query;
+ else {
+ queryBegin = c;
+ state = State::NonUTF8Query;
+ }
</ins><span class="cx"> m_url.m_pathAfterLastSlash = currentPosition(c) - 1;
</span><span class="cx"> m_url.m_pathEnd = m_url.m_pathAfterLastSlash;
</span><del>- state = State::Query;
</del><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> if (UNLIKELY(*c == '#')) {
</span><span class="lines">@@ -1601,7 +1643,14 @@
</span><span class="cx"> }
</span><span class="cx"> if (*c == '?') {
</span><span class="cx"> m_url.m_pathEnd = currentPosition(c);
</span><del>- state = State::Query;
</del><ins>+ appendToASCIIBuffer('?');
+ ++c;
+ if (isUTF8Encoding)
+ state = State::UTF8Query;
+ else {
+ queryBegin = c;
+ state = State::NonUTF8Query;
+ }
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> if (*c == '#') {
</span><span class="lines">@@ -1628,7 +1677,14 @@
</span><span class="cx"> LOG_STATE("CannotBeABaseURLPath");
</span><span class="cx"> if (*c == '?') {
</span><span class="cx"> m_url.m_pathEnd = currentPosition(c);
</span><del>- state = State::Query;
</del><ins>+ appendToASCIIBuffer('?');
+ ++c;
+ if (isUTF8Encoding)
+ state = State::UTF8Query;
+ else {
+ queryBegin = c;
+ state = State::NonUTF8Query;
+ }
</ins><span class="cx"> } else if (*c == '#') {
</span><span class="cx"> m_url.m_pathEnd = currentPosition(c);
</span><span class="cx"> m_url.m_queryEnd = m_url.m_pathEnd;
</span><span class="lines">@@ -1642,11 +1698,10 @@
</span><span class="cx"> ++c;
</span><span class="cx"> }
</span><span class="cx"> break;
</span><del>- case State::Query:
- LOG_STATE("Query");
</del><ins>+ case State::UTF8Query:
+ LOG_STATE("UTF8Query");
+ ASSERT(queryBegin == CodePointIterator<CharacterType>());
</ins><span class="cx"> if (*c == '#') {
</span><del>- if (!isUTF8Encoding)
- encodeQuery(queryBuffer, encoding);
</del><span class="cx"> m_url.m_queryEnd = currentPosition(c);
</span><span class="cx"> state = State::Fragment;
</span><span class="cx"> break;
</span><span class="lines">@@ -1657,6 +1712,20 @@
</span><span class="cx"> appendCodePoint(queryBuffer, *c);
</span><span class="cx"> ++c;
</span><span class="cx"> break;
</span><ins>+ case State::NonUTF8Query:
+ do {
+ LOG_STATE("NonUTF8Query");
+ ASSERT(queryBegin != CodePointIterator<CharacterType>());
+ if (*c == '#') {
+ encodeQuery(queryBuffer, encoding, CodePointIterator<CharacterType>(queryBegin, c));
+ m_url.m_queryEnd = currentPosition(c);
+ state = State::Fragment;
+ break;
+ }
+ appendCodePoint(queryBuffer, *c);
+ advance(c, queryBegin);
+ } while (!c.atEnd());
+ break;
</ins><span class="cx"> case State::Fragment:
</span><span class="cx"> do {
</span><span class="cx"> LOG(URLParser, "State Fragment");
</span><span class="lines">@@ -1859,13 +1928,19 @@
</span><span class="cx"> m_url.m_queryEnd = m_url.m_pathEnd;
</span><span class="cx"> m_url.m_fragmentEnd = m_url.m_pathEnd;
</span><span class="cx"> break;
</span><del>- case State::Query:
- LOG_FINAL_STATE("Query");
- if (!isUTF8Encoding)
- encodeQuery(queryBuffer, encoding);
</del><ins>+ case State::UTF8Query:
+ LOG_FINAL_STATE("UTF8Query");
+ ASSERT(queryBegin == CodePointIterator<CharacterType>());
</ins><span class="cx"> m_url.m_queryEnd = currentPosition(c);
</span><span class="cx"> m_url.m_fragmentEnd = m_url.m_queryEnd;
</span><span class="cx"> break;
</span><ins>+ case State::NonUTF8Query:
+ LOG_FINAL_STATE("NonUTF8Query");
+ ASSERT(queryBegin != CodePointIterator<CharacterType>());
+ encodeQuery(queryBuffer, encoding, CodePointIterator<CharacterType>(queryBegin, c));
+ m_url.m_queryEnd = currentPosition(c);
+ m_url.m_fragmentEnd = m_url.m_queryEnd;
+ break;
</ins><span class="cx"> case State::Fragment:
</span><span class="cx"> {
</span><span class="cx"> LOG_FINAL_STATE("Fragment");
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URLParser.h (206647 => 206648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URLParser.h        2016-09-30 18:44:16 UTC (rev 206647)
+++ trunk/Source/WebCore/platform/URLParser.h        2016-09-30 18:46:28 UTC (rev 206648)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> void appendToASCIIBuffer(UChar32);
</span><span class="cx"> void appendToASCIIBuffer(const char*, size_t);
</span><span class="cx"> void appendToASCIIBuffer(const LChar* characters, size_t size) { appendToASCIIBuffer(reinterpret_cast<const char*>(characters), size); }
</span><del>- void encodeQuery(const Vector<UChar>& source, const TextEncoding&);
</del><ins>+ template<typename CharacterType> void encodeQuery(const Vector<UChar>& source, const TextEncoding&, CodePointIterator<CharacterType>);
</ins><span class="cx"> void copyASCIIStringUntil(const String&, size_t lengthIf8Bit, size_t lengthIf16Bit);
</span><span class="cx"> StringView parsedDataView(size_t start, size_t length);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (206647 => 206648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-09-30 18:44:16 UTC (rev 206647)
+++ trunk/Tools/ChangeLog        2016-09-30 18:46:28 UTC (rev 206648)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-09-30 Alex Christensen <achristensen@webkit.org>
+
+ URLParser: handle syntax violations in non-UTF-8 encoded queries
+ https://bugs.webkit.org/show_bug.cgi?id=162770
+
+ Reviewed by Tim Horton.
+
+ * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
+ (TestWebKitAPI::checkURL):
+ (TestWebKitAPI::TEST_F):
+ Tests with emoji change behavior when we insert a tab between the surrogates, so don't do the
+ insert-tab-at-each-location verification that syntax violations are handled correctly.
+
</ins><span class="cx"> 2016-09-30 Megan Gardner <megan_gardner@apple.com>
</span><span class="cx">
</span><span class="cx"> Make it possible to test web-related user-interface features
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebCoreURLParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (206647 => 206648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp        2016-09-30 18:44:16 UTC (rev 206647)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp        2016-09-30 18:46:28 UTC (rev 206648)
</span><span class="lines">@@ -961,7 +961,7 @@
</span><span class="cx"> {"http", "", "", "w", 0, "/", "%ED%A0%80", "", "http://w/?%ED%A0%80"});
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void checkURL(const String& urlString, const TextEncoding& encoding, const ExpectedParts& parts)
</del><ins>+static void checkURL(const String& urlString, const TextEncoding& encoding, const ExpectedParts& parts, bool checkTabs = true)
</ins><span class="cx"> {
</span><span class="cx"> URLParser parser(urlString, { }, encoding);
</span><span class="cx"> auto url = parser.result();
</span><span class="lines">@@ -975,13 +975,32 @@
</span><span class="cx"> EXPECT_TRUE(eq(parts.fragment, url.fragmentIdentifier()));
</span><span class="cx"> EXPECT_TRUE(eq(parts.string, url.string()));
</span><span class="cx">
</span><del>- // FIXME: check tabs here like we do for checkURL and checkRelativeURL.
</del><ins>+ if (checkTabs) {
+ for (size_t i = 0; i < urlString.length(); ++i) {
+ String urlStringWithTab = makeString(urlString.substring(0, i), "\t", urlString.substring(i));
+ ExpectedParts invalidPartsWithTab = {"", "", "", "", 0, "" , "", "", urlStringWithTab};
+ checkURL(urlStringWithTab, encoding, parts.isInvalid() ? invalidPartsWithTab : parts, false);
+ }
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> TEST_F(URLParserTest, QueryEncoding)
</span><span class="cx"> {
</span><del>- checkURL(utf16String(u"http://host?ß😍#ß😍"), UTF8Encoding(), {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", utf16String(u"ß😍"), utf16String(u"http://host/?%C3%9F%F0%9F%98%8D#ß😍")});
- // FIXME: Add tests with other encodings.
</del><ins>+ checkURL(utf16String(u"http://host?ß😍#ß😍"), UTF8Encoding(), {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", utf16String(u"ß😍"), utf16String(u"http://host/?%C3%9F%F0%9F%98%8D#ß😍")}, false);
+ checkURL(utf16String(u"http://host?ß😍#ß😍"), UTF8Encoding(), {"http", "", "", "host", 0, "/", "%C3%9F%F0%9F%98%8D", utf16String(u"ß😍"), utf16String(u"http://host/?%C3%9F%F0%9F%98%8D#ß😍")}, false);
+
+ TextEncoding latin1(String("latin1"));
+ checkURL("http://host/?query with%20spaces", latin1, {"http", "", "", "host", 0, "/", "query%20with%20spaces", "", "http://host/?query%20with%20spaces"});
+ checkURL("http://host/?query", latin1, {"http", "", "", "host", 0, "/", "query", "", "http://host/?query"});
+ checkURL("http://host/?\tquery", latin1, {"http", "", "", "host", 0, "/", "query", "", "http://host/?query"});
+ checkURL("http://host/?q\tuery", latin1, {"http", "", "", "host", 0, "/", "query", "", "http://host/?query"});
+ checkURL("http://host/?query with SpAcEs#fragment", latin1, {"http", "", "", "host", 0, "/", "query%20with%20SpAcEs", "fragment", "http://host/?query%20with%20SpAcEs#fragment"});
+
+ TextEncoding unrecognized(String("unrecognized invalid encoding name"));
+ checkURL("http://host/?query", unrecognized, {"http", "", "", "host", 0, "/", "", "", "http://host/?"});
+ checkURL("http://host/?", unrecognized, {"http", "", "", "host", 0, "/", "", "", "http://host/?"});
+
+ // FIXME: Add more tests with other encodings and things like non-ascii characters, emoji and unmatched surrogate pairs.
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre>
</div>
</div>
</body>
</html>