Move user agent quirks to cross-platform location
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2016 11:30:17 +0000 (11:30 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Oct 2016 11:30:17 +0000 (11:30 +0000)
commitaac0d235a07e1017b5357d984f2033389ab1fc2d
tree86bde6c36a93c74c2ef823f552716f6371e16d90
parent2bfdf68126af2c9be267d80553c8d3781376072e
Move user agent quirks to cross-platform location
https://bugs.webkit.org/show_bug.cgi?id=163508

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Tested by Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp.

* PlatformGTK.cmake:
* platform/UserAgent.h: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.h.
* platform/UserAgentQuirks.cpp: Added. Moved from UserAgentGtk.cpp.
(WebCore::urlRequiresChromeBrowser): Sneakily tighten up Google domain detection, it should
only apply to sites if the base domain matches google.*, not any base domain that starts
with google.
(WebCore::urlRequiresMacintoshPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
(WebCore::UserAgentQuirks::stringForQuirk):
* platform/UserAgentQuirks.h: Moved from UserAgentGtk.cpp. prepare-ChangeLog thinks it was
renamed from Source/WebCore/platform/efl/UserAgentEfl.h, but prepare-ChangeLog is dumb.
(WebCore::UserAgentQuirks::UserAgentQuirks):
(WebCore::UserAgentQuirks::add):
(WebCore::UserAgentQuirks::contains):
(WebCore::UserAgentQuirks::isEmpty):
* platform/efl/UserAgentEfl.cpp:
(WebCore::standardUserAgentForURL):
* platform/gtk/UserAgentGtk.cpp:
(WebCore::buildUserAgentString):
(WebCore::standardUserAgentForURL):
(): Deleted.
(WebCore::UserAgentQuirks::UserAgentQuirks): Deleted.
(WebCore::UserAgentQuirks::add): Deleted.
(WebCore::UserAgentQuirks::contains): Deleted.
(WebCore::UserAgentQuirks::isEmpty): Deleted.
(WebCore::urlRequiresChromeBrowser): Deleted.
(WebCore::urlRequiresMacintoshPlatform): Deleted.

Source/WebKit2:

#include <WebCore/UserAgent.h> instead of <WebCore/UserAgentGtk.h>.

* UIProcess/API/gtk/WebKitSettings.cpp:
* UIProcess/efl/WebPageProxyEfl.cpp:
* UIProcess/gtk/WebPageProxyGtk.cpp:
* WebProcess/WebPage/gtk/WebPageGtk.cpp:

Tools:

Move the test to a cross-platform location and improve it to better check the full list of
sites we have defined quirks for.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp: Renamed from Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp.
(TestWebKitAPI::assertUserAgentForURLHasChromeBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasMacPlatformQuirk):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/UserAgent.h [moved from Source/WebCore/platform/gtk/UserAgentGtk.h with 87% similarity]
Source/WebCore/platform/UserAgentQuirks.cpp [new file with mode: 0644]
Source/WebCore/platform/UserAgentQuirks.h [moved from Source/WebCore/platform/efl/UserAgentEfl.h with 60% similarity]
Source/WebCore/platform/efl/UserAgentEfl.cpp
Source/WebCore/platform/gtk/UserAgentGtk.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp
Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/PlatformGTK.cmake
Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp [moved from Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp with 54% similarity]