Clean up old URL parser remnants
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Nov 2017 19:15:23 +0000 (19:15 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Nov 2017 19:15:23 +0000 (19:15 +0000)
commita1f901098ee344568b15a80785b3d214d9a8fd1c
tree50afb2c3b100672b8059cd5d6c9ee5236cffd2cc
parent5269cd9a8e3c5b4d3f60ff593fd7c6f5ffc46e07
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/fileapi/BlobURL.cpp
Source/WebCore/loader/appcache/ApplicationCacheHost.cpp
Source/WebCore/platform/URL.cpp
Source/WebCore/platform/URLParser.cpp
Source/WebCore/platform/URLParser.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.cpp