URLParser should not consider path of URLs with no host to start at the first slash...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 00:30:31 +0000 (00:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 00:30:31 +0000 (00:30 +0000)
commit06633f48b646708b031b75aff5cf2cdc8912770f
treea6b9448ca7bc0b0d46e3de27c5b0df34a8c4ad42
parentdfbabbc400ca06b7480f415dc5e072d4944ae98c
URLParser should not consider path of URLs with no host to start at the first slash after the colon
https://bugs.webkit.org/show_bug.cgi?id=164555

Patch by Alex Christensen <achristensen@webkit.org> on 2016-11-09
Reviewed by Tim Horton.

LayoutTests/imported/w3c:

* web-platform-tests/url/a-element-expected.txt:
* web-platform-tests/url/a-element-xhtml-expected.txt:
* web-platform-tests/url/url-constructor-expected.txt:

Source/WebCore:

When we see a url that is only scheme:// we treated the // as the path.  Firefox did this with unrecognized schemes,
but based on https://github.com/whatwg/url/issues/148 they seem willing to change.  We had added similar behavior to
URL::parse, and I added this to URLParser in r206783 which this effectively reverts.

Covered by API and layout tests.

* platform/URLParser.cpp:
(WebCore::URLParser::parse):
Don't move m_userStart to m_pathStart back by two when we see an empty host.

Tools:

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

LayoutTests:

* fast/url/segments-expected.txt:
* fast/url/segments-from-data-url-expected.txt:
* fast/loader/url-parse-1-expected.txt:
* fetch/fetch-url-serialization-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/loader/url-parse-1-expected.txt
LayoutTests/fast/url/segments-expected.txt
LayoutTests/fast/url/segments-from-data-url-expected.txt
LayoutTests/fetch/fetch-url-serialization-expected.txt
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/url/a-element-expected.txt
LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml-expected.txt
LayoutTests/imported/w3c/web-platform-tests/url/url-constructor-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/URLParser.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp