Modified: trunk/Source/WebCore/platform/URLParser.cpp (205146 => 205147)
--- trunk/Source/WebCore/platform/URLParser.cpp 2016-08-29 21:12:29 UTC (rev 205146)
+++ trunk/Source/WebCore/platform/URLParser.cpp 2016-08-29 21:15:27 UTC (rev 205147)
@@ -220,8 +220,15 @@
m_buffer.append('/');
state = State::PathOrAuthority;
++c;
- } else
+ } else {
+ m_url.m_userStart = m_buffer.length();
+ m_url.m_userEnd = m_url.m_userStart;
+ m_url.m_passwordEnd = m_url.m_userStart;
+ m_url.m_hostEnd = m_url.m_userStart;
+ m_url.m_portEnd = m_url.m_userStart;
+ m_url.m_pathAfterLastSlash = m_url.m_userStart,
state = State::CannotBeABaseURLPath;
+ }
break;
case State::NoScheme:
LOG_STATE("NoScheme");
@@ -404,8 +411,17 @@
break;
case State::CannotBeABaseURLPath:
LOG_STATE("CannotBeABaseURLPath");
- notImplemented();
- ++c;
+ if (*c == '?') {
+ m_url.m_pathEnd = m_buffer.length();
+ state = State::Query;
+ } else if (*c == '#') {
+ m_url.m_pathEnd = m_buffer.length();
+ m_url.m_queryEnd = m_url.m_pathEnd;
+ state = State::Fragment;
+ } else {
+ m_buffer.append(*c);
+ ++c;
+ }
break;
case State::Query:
LOG_STATE("Query");
@@ -492,6 +508,9 @@
break;
case State::CannotBeABaseURLPath:
LOG_FINAL_STATE("CannotBeABaseURLPath");
+ m_url.m_pathEnd = m_buffer.length();
+ m_url.m_queryEnd = m_url.m_pathEnd;
+ m_url.m_fragmentEnd = m_url.m_pathEnd;
break;
case State::Query:
LOG_FINAL_STATE("Query");
Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp (205146 => 205147)
--- trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp 2016-08-29 21:12:29 UTC (rev 205146)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp 2016-08-29 21:15:27 UTC (rev 205147)
@@ -91,7 +91,9 @@
checkURL("http://127.0.0.1", {"http", "", "", "127.0.0.1", 0, "/", "", "", "http://127.0.0.1/"});
checkURL("http://webkit.org/", {"http", "", "", "webkit.org", 0, "/", "", "", "http://webkit.org/"});
checkURL("http://webkit.org/path1/path2/index.html", {"http", "", "", "webkit.org", 0, "/path1/path2/index.html", "", "", "http://webkit.org/path1/path2/index.html"});
-
+ checkURL("about:blank", {"about", "", "", "", 0, "blank", "", "", "about:blank"});
+ checkURL("about:blank?query", {"about", "", "", "", 0, "blank", "query", "", "about:blank?query"});
+ checkURL("about:blank#fragment", {"about", "", "", "", 0, "blank", "", "fragment", "about:blank#fragment"});
}
static void checkRelativeURL(const String& urlString, const String& baseURLString, const ExpectedParts& parts)