[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
authorMs2ger@igalia.com <Ms2ger@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Dec 2018 14:08:46 +0000 (14:08 +0000)
committerMs2ger@igalia.com <Ms2ger@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Dec 2018 14:08:46 +0000 (14:08 +0000)
commit6397d7aa754d58ec1dde8ebae46e3f334c16d2a5
tree718fbecf6c265125802aba9e00ad6622bb824df1
parent9770f6bbf6e489e8f3cb0e4746d3c67752b331db
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816

Reviewed by Michael Catanzaro.

Source/WebCore:

Tests: enabled fast/url/user-visible/.

* testing/Internals.cpp:
(WebCore::Internals::userVisibleString): Enable method on all platforms.

Source/WebKit:

Add webkit_uri_for_display for GTK and WPE.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitURIUtilities.cpp: Added.
(webkit_uri_for_display):
* UIProcess/API/gtk/WebKitURIUtilities.h: Added.
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitURIUtilities.h: Added.
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:

Source/WTF:

Translate userVisibleString and dependent code into platform-neutral C++
in wtf/URLHelpers.{h,cpp}.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/URLHelpers.cpp: Added.
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::URLHelpers::isArmenianLookalikeCharacter):
(WTF::URLHelpers::isArmenianScriptCharacter):
(WTF::URLHelpers::isASCIIDigitOrValidHostCharacter):
(WTF::URLHelpers::isLookalikeCharacter):
(WTF::URLHelpers::whiteListIDNScript):
(WTF::URLHelpers::initializeDefaultIDNScriptWhiteList):
(WTF::URLHelpers::allCharactersInIDNScriptWhiteList):
(WTF::URLHelpers::isSecondLevelDomainNameAllowedByTLDRules):
(WTF::URLHelpers::isRussianDomainNameCharacter):
(WTF::URLHelpers::allCharactersAllowedByTLDRules):
(WTF::URLHelpers::mapHostName):
(WTF::URLHelpers::collectRangesThatNeedMapping):
(WTF::URLHelpers::applyHostNameFunctionToMailToURLString):
(WTF::URLHelpers::applyHostNameFunctionToURLString):
(WTF::URLHelpers::mapHostNames):
(WTF::URLHelpers::createStringWithEscapedUnsafeCharacters):
(WTF::URLHelpers::userVisibleURL):
* wtf/URLHelpers.h: Added.
* wtf/cocoa/NSURLExtras.mm:
(WTF::URLHelpers::loadIDNScriptWhiteList):
(WTF::decodePercentEscapes):
(WTF::decodeHostName):
(WTF::encodeHostName):
(WTF::URLWithUserTypedString):
(WTF::userVisibleString):

Tools:

Add tests for userVisibleString() and (for GTK and WPE) webkit_uri_for_display().

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/URLHelpers.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitURIUtilities.cpp: Added.
(testURIForDisplayUnaffected):
(testURIForDisplayAffected):
(beforeAll):
(afterAll):
* TestWebKitAPI/glib/CMakeLists.txt:

LayoutTests:

* TestExpectations: Enable fast/url/user-visible/.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/URLHelpers.cpp [new file with mode: 0644]
Source/WTF/wtf/URLHelpers.h [new file with mode: 0644]
Source/WTF/wtf/cocoa/NSURLExtras.mm
Source/WebCore/ChangeLog
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/PlatformGTK.cmake
Source/WebKit/PlatformWPE.cmake
Source/WebKit/SourcesGTK.txt
Source/WebKit/SourcesWPE.txt
Source/WebKit/UIProcess/API/glib/WebKitURIUtilities.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/API/gtk/WebKitURIUtilities.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt
Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml
Source/WebKit/UIProcess/API/gtk/webkit2.h
Source/WebKit/UIProcess/API/wpe/WebKitURIUtilities.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/docs/wpe-0.1-sections.txt
Source/WebKit/UIProcess/API/wpe/docs/wpe-docs.sgml
Source/WebKit/UIProcess/API/wpe/webkit.h
Tools/ChangeLog
Tools/TestWebKitAPI/CMakeLists.txt
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WTF/URLHelpers.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitURIUtilities.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/glib/CMakeLists.txt