Title: [274628] releases/WebKitGTK/webkit-2.30
- Revision
- 274628
- Author
- [email protected]
- Date
- 2021-03-18 02:49:26 -0700 (Thu, 18 Mar 2021)
Log Message
Merge r272921 - [GTK] Need new user agent quirk for Google Docs and Google Drive
https://bugs.webkit.org/show_bug.cgi?id=221845
Patch by Michael Catanzaro <[email protected]> on 2021-02-16
Reviewed by Adrian Perez de Castro.
Source/WebCore:
Switch Google Docs to use a Chrome browser quirk instead of an Internet Explorer quirk.
Remove the Google Drive quirk altogether. Remove the Internet Explorer and Windows platform
quirks, which are no longer used. Retarget the Google Docs quirk to apply only to
docs.google.com because we no longer need to send the quirk to accounts.youtube.com for it
to be effective. Lastly, update Chrome and Firefox version strings for good measure.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):
(WebCore::urlRequiresLinuxDesktopPlatform):
(WebCore::UserAgentQuirks::quirksForURL):
(WebCore::UserAgentQuirks::stringForQuirk):
(WebCore::urlRequiresInternetExplorerBrowser): Deleted.
(WebCore::urlRequiresWindowsPlatform): Deleted.
* platform/glib/UserAgentGLib.cpp:
(WebCore::buildUserAgentString):
Tools:
* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::assertUserAgentForURLHasChromeBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasFirefoxBrowserQuirk):
(TestWebKitAPI::assertUserAgentForURLHasLinuxPlatformQuirk):
(TestWebKitAPI::assertUserAgentForURLHasMacPlatformQuirk):
(TestWebKitAPI::TEST):
(TestWebKitAPI::assertUserAgentForURLHasInternetExplorerBrowserQuirk): Deleted.
(TestWebKitAPI::assertUserAgentForURLHasWindowsPlatformQuirk): Deleted.
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog (274627 => 274628)
--- releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog 2021-03-18 09:29:54 UTC (rev 274627)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/ChangeLog 2021-03-18 09:49:26 UTC (rev 274628)
@@ -1,3 +1,26 @@
+2021-02-16 Michael Catanzaro <[email protected]>
+
+ [GTK] Need new user agent quirk for Google Docs and Google Drive
+ https://bugs.webkit.org/show_bug.cgi?id=221845
+
+ Reviewed by Adrian Perez de Castro.
+
+ Switch Google Docs to use a Chrome browser quirk instead of an Internet Explorer quirk.
+ Remove the Google Drive quirk altogether. Remove the Internet Explorer and Windows platform
+ quirks, which are no longer used. Retarget the Google Docs quirk to apply only to
+ docs.google.com because we no longer need to send the quirk to accounts.youtube.com for it
+ to be effective. Lastly, update Chrome and Firefox version strings for good measure.
+
+ * platform/UserAgentQuirks.cpp:
+ (WebCore::urlRequiresChromeBrowser):
+ (WebCore::urlRequiresLinuxDesktopPlatform):
+ (WebCore::UserAgentQuirks::quirksForURL):
+ (WebCore::UserAgentQuirks::stringForQuirk):
+ (WebCore::urlRequiresInternetExplorerBrowser): Deleted.
+ (WebCore::urlRequiresWindowsPlatform): Deleted.
+ * platform/glib/UserAgentGLib.cpp:
+ (WebCore::buildUserAgentString):
+
2021-02-10 Xabier Rodriguez Calvar <[email protected]>
[GStreamer] Make m_client WeakPtr in AudioSourceProviderGStreamer
Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/UserAgentQuirks.cpp (274627 => 274628)
--- releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/UserAgentQuirks.cpp 2021-03-18 09:29:54 UTC (rev 274627)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/UserAgentQuirks.cpp 2021-03-18 09:49:26 UTC (rev 274628)
@@ -81,6 +81,10 @@
if (baseDomain == "bankofamerica.com")
return true;
+ // Google Docs shows an unsupported browser warning with WebKitGTK's
+ // standard user agent.
+ if (domain == "docs.google.com")
+ return true;
return false;
}
@@ -101,31 +105,6 @@
return false;
}
-static bool urlRequiresInternetExplorerBrowser(const URL& url)
-{
- String domain = url.host().toString();
-
- // This quirk actually has nothing to do with YouTube. It's needed to avoid
- // unsupported browser warnings on Google Docs. Why do we need this weird
- // quirk? We cannot use Chrome or Firefox quirks because Google then uses
- // features that don't work in WebKit. And we can't use our macOS platform
- // quirk because Google then expects command keys and doesn't support basic
- // keyboard shortcuts. We could pretend to be Edge, but adding Chromium is
- // likely to break in the same way as a Chrome quirk. So that leaves us
- // with IE browser as the final reasonable option. This will break
- // eventually, but hopefully not for a long time, because we are probably
- // out of options when it does.
- if (domain == "accounts.youtube.com" || domain == "docs.google.com")
- return true;
-
- // Google Drive shows an unsupported browser warning with WebKitGTK's
- // standard user agent.
- if (domain == "drive.google.com")
- return true;
-
- return false;
-}
-
static bool urlRequiresMacintoshPlatform(const URL& url)
{
String domain = url.host().toString();
@@ -163,14 +142,9 @@
return false;
}
-static bool urlRequiresWindowsPlatform(const URL& url)
-{
- return urlRequiresInternetExplorerBrowser(url);
-}
-
static bool urlRequiresLinuxDesktopPlatform(const URL& url)
{
- return isGoogle(url) && !urlRequiresInternetExplorerBrowser(url) && chassisType() != WTF::ChassisType::Mobile;
+ return isGoogle(url) && chassisType() != WTF::ChassisType::Mobile;
}
UserAgentQuirks UserAgentQuirks::quirksForURL(const URL& url)
@@ -183,13 +157,9 @@
quirks.add(UserAgentQuirks::NeedsChromeBrowser);
else if (urlRequiresFirefoxBrowser(url))
quirks.add(UserAgentQuirks::NeedsFirefoxBrowser);
- else if (urlRequiresInternetExplorerBrowser(url))
- quirks.add(UserAgentQuirks::NeedsInternetExplorerBrowser);
if (urlRequiresMacintoshPlatform(url))
quirks.add(UserAgentQuirks::NeedsMacintoshPlatform);
- else if (urlRequiresWindowsPlatform(url))
- quirks.add(UserAgentQuirks::NeedsWindowsPlatform);
else if (urlRequiresLinuxDesktopPlatform(url))
quirks.add(UserAgentQuirks::NeedsLinuxDesktopPlatform);
@@ -201,15 +171,11 @@
switch (quirk) {
case NeedsChromeBrowser:
// Get versions from https://chromium.googlesource.com/chromium/src.git
- return "Chrome/86.0.4208.2"_s;
+ return "Chrome/90.0.4419.1"_s;
case NeedsFirefoxBrowser:
- return "; rv:80.0) Gecko/20100101 Firefox/80.0"_s;
- case NeedsInternetExplorerBrowser:
- return "; Trident/7.0; rv:11.0) like Gecko"_s;
+ return "; rv:87.0) Gecko/20100101 Firefox/87.0"_s;
case NeedsMacintoshPlatform:
return "Macintosh; Intel Mac OS X 10_15"_s;
- case NeedsWindowsPlatform:
- return "Windows NT 10.0"_s;
case NeedsLinuxDesktopPlatform:
return "X11; Linux x86_64"_s;
case NumUserAgentQuirks:
Modified: releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/glib/UserAgentGLib.cpp (274627 => 274628)
--- releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/glib/UserAgentGLib.cpp 2021-03-18 09:29:54 UTC (rev 274627)
+++ releases/WebKitGTK/webkit-2.30/Source/WebCore/platform/glib/UserAgentGLib.cpp 2021-03-18 09:49:26 UTC (rev 274628)
@@ -89,8 +89,6 @@
if (quirks.contains(UserAgentQuirks::NeedsMacintoshPlatform))
uaString.append(UserAgentQuirks::stringForQuirk(UserAgentQuirks::NeedsMacintoshPlatform));
- else if (quirks.contains(UserAgentQuirks::NeedsWindowsPlatform))
- uaString.append(UserAgentQuirks::stringForQuirk(UserAgentQuirks::NeedsWindowsPlatform));
else if (quirks.contains(UserAgentQuirks::NeedsLinuxDesktopPlatform))
uaString.append(UserAgentQuirks::stringForQuirk(UserAgentQuirks::NeedsLinuxDesktopPlatform));
else {
@@ -106,10 +104,6 @@
uaString.append(UserAgentQuirks::stringForQuirk(UserAgentQuirks::NeedsFirefoxBrowser));
return uaString.toString();
}
- if (quirks.contains(UserAgentQuirks::NeedsInternetExplorerBrowser)) {
- uaString.append(UserAgentQuirks::stringForQuirk(UserAgentQuirks::NeedsInternetExplorerBrowser));
- return uaString.toString();
- }
uaString.appendLiteral(") AppleWebKit/");
uaString.append(versionForUAString());
Modified: releases/WebKitGTK/webkit-2.30/Tools/ChangeLog (274627 => 274628)
--- releases/WebKitGTK/webkit-2.30/Tools/ChangeLog 2021-03-18 09:29:54 UTC (rev 274627)
+++ releases/WebKitGTK/webkit-2.30/Tools/ChangeLog 2021-03-18 09:49:26 UTC (rev 274628)
@@ -1,3 +1,19 @@
+2021-02-16 Michael Catanzaro <[email protected]>
+
+ [GTK] Need new user agent quirk for Google Docs and Google Drive
+ https://bugs.webkit.org/show_bug.cgi?id=221845
+
+ Reviewed by Adrian Perez de Castro.
+
+ * TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
+ (TestWebKitAPI::assertUserAgentForURLHasChromeBrowserQuirk):
+ (TestWebKitAPI::assertUserAgentForURLHasFirefoxBrowserQuirk):
+ (TestWebKitAPI::assertUserAgentForURLHasLinuxPlatformQuirk):
+ (TestWebKitAPI::assertUserAgentForURLHasMacPlatformQuirk):
+ (TestWebKitAPI::TEST):
+ (TestWebKitAPI::assertUserAgentForURLHasInternetExplorerBrowserQuirk): Deleted.
+ (TestWebKitAPI::assertUserAgentForURLHasWindowsPlatformQuirk): Deleted.
+
2020-11-26 Michael Catanzaro <[email protected]>
[WPE][GTK] Use Internet Explorer quirk for Google Docs
Modified: releases/WebKitGTK/webkit-2.30/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp (274627 => 274628)
--- releases/WebKitGTK/webkit-2.30/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp 2021-03-18 09:29:54 UTC (rev 274627)
+++ releases/WebKitGTK/webkit-2.30/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp 2021-03-18 09:49:26 UTC (rev 274628)
@@ -41,7 +41,6 @@
EXPECT_FALSE(uaString.contains("Chromium"));
EXPECT_FALSE(uaString.contains("Firefox"));
EXPECT_FALSE(uaString.contains("Version"));
- EXPECT_FALSE(uaString.contains("Trident"));
}
static void assertUserAgentForURLHasFirefoxBrowserQuirk(const char* url)
@@ -53,21 +52,8 @@
EXPECT_FALSE(uaString.contains("Chromium"));
EXPECT_TRUE(uaString.contains("Firefox"));
EXPECT_FALSE(uaString.contains("Version"));
- EXPECT_FALSE(uaString.contains("Trident"));
}
-static void assertUserAgentForURLHasInternetExplorerBrowserQuirk(const char* url)
-{
- String uaString = standardUserAgentForURL(URL({ }, url));
-
- EXPECT_FALSE(uaString.contains("Chrome"));
- EXPECT_FALSE(uaString.contains("Safari"));
- EXPECT_FALSE(uaString.contains("Chromium"));
- EXPECT_FALSE(uaString.contains("Firefox"));
- EXPECT_FALSE(uaString.contains("Version"));
- EXPECT_TRUE(uaString.contains("Trident"));
-}
-
static void assertUserAgentForURLHasLinuxPlatformQuirk(const char* url)
{
String uaString = standardUserAgentForURL(URL({ }, url));
@@ -75,23 +61,10 @@
EXPECT_TRUE(uaString.contains("Linux"));
EXPECT_FALSE(uaString.contains("Macintosh"));
EXPECT_FALSE(uaString.contains("Mac OS X"));
- EXPECT_FALSE(uaString.contains("Windows"));
EXPECT_FALSE(uaString.contains("Chrome"));
EXPECT_FALSE(uaString.contains("FreeBSD"));
}
-static void assertUserAgentForURLHasWindowsPlatformQuirk(const char* url)
-{
- String uaString = standardUserAgentForURL(URL({ }, url));
-
- EXPECT_FALSE(uaString.contains("Macintosh"));
- EXPECT_FALSE(uaString.contains("Mac OS X"));
- EXPECT_FALSE(uaString.contains("Linux"));
- EXPECT_TRUE(uaString.contains("Windows"));
- EXPECT_FALSE(uaString.contains("Chrome"));
- EXPECT_FALSE(uaString.contains("FreeBSD"));
-}
-
static void assertUserAgentForURLHasMacPlatformQuirk(const char* url)
{
String uaString = standardUserAgentForURL(URL({ }, url));
@@ -99,7 +72,6 @@
EXPECT_TRUE(uaString.contains("Macintosh"));
EXPECT_TRUE(uaString.contains("Mac OS X"));
EXPECT_FALSE(uaString.contains("Linux"));
- EXPECT_FALSE(uaString.contains("Windows"));
EXPECT_FALSE(uaString.contains("Chrome"));
EXPECT_FALSE(uaString.contains("FreeBSD"));
}
@@ -120,17 +92,10 @@
assertUserAgentForURLHasChromeBrowserQuirk("http://typekit.net/");
assertUserAgentForURLHasChromeBrowserQuirk("http://auth.mayohr.com/");
assertUserAgentForURLHasChromeBrowserQuirk("http://bankofamerica.com/");
+ assertUserAgentForURLHasChromeBrowserQuirk("http://docs.google.com/");
assertUserAgentForURLHasFirefoxBrowserQuirk("http://bugzilla.redhat.com/");
- assertUserAgentForURLHasInternetExplorerBrowserQuirk("http://accounts.youtube.com/");
- assertUserAgentForURLHasInternetExplorerBrowserQuirk("http://docs.google.com/");
- assertUserAgentForURLHasInternetExplorerBrowserQuirk("http://drive.google.com/");
-
- assertUserAgentForURLHasWindowsPlatformQuirk("http://accounts.youtube.com/");
- assertUserAgentForURLHasWindowsPlatformQuirk("http://docs.google.com/");
- assertUserAgentForURLHasWindowsPlatformQuirk("http://drive.google.com/");
-
assertUserAgentForURLHasLinuxPlatformQuirk("http://www.google.com/");
assertUserAgentForURLHasLinuxPlatformQuirk("http://www.google.es/");
assertUserAgentForURLHasLinuxPlatformQuirk("http://calendar.google.com/");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes