Title: [160354] trunk/Source/WebCore
Revision
160354
Author
g...@gnome.org
Date
2013-12-10 02:19:06 -0800 (Tue, 10 Dec 2013)

Log Message

[GTK] REGRESSION: www.yahoo.com redirects to the mobile version after UA change
https://bugs.webkit.org/show_bug.cgi?id=125444

Reviewed by Martin Robinson.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::platformVersionForUAString): more correctly pretend we're Mac OS X.
(WebCore::standardUserAgent): ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (160353 => 160354)


--- trunk/Source/WebCore/ChangeLog	2013-12-10 10:18:29 UTC (rev 160353)
+++ trunk/Source/WebCore/ChangeLog	2013-12-10 10:19:06 UTC (rev 160354)
@@ -1,3 +1,14 @@
+2013-12-10  Gustavo Noronha Silva  <g...@gnome.org>
+
+        [GTK] REGRESSION: www.yahoo.com redirects to the mobile version after UA change
+        https://bugs.webkit.org/show_bug.cgi?id=125444
+
+        Reviewed by Martin Robinson.
+
+        * platform/gtk/UserAgentGtk.cpp:
+        (WebCore::platformVersionForUAString): more correctly pretend we're Mac OS X.
+        (WebCore::standardUserAgent): ditto.
+
 2013-12-09  Gustavo Noronha Silva  <g...@gnome.org>
 
         [Soup] Send original encoded data size to didReceiveBuffer

Modified: trunk/Source/WebCore/platform/gtk/UserAgentGtk.cpp (160353 => 160354)


--- trunk/Source/WebCore/platform/gtk/UserAgentGtk.cpp	2013-12-10 10:18:29 UTC (rev 160353)
+++ trunk/Source/WebCore/platform/gtk/UserAgentGtk.cpp	2013-12-10 10:19:06 UTC (rev 160354)
@@ -30,13 +30,10 @@
 
 #if OS(UNIX)
 #include <sys/utsname.h>
-#elif OS(WINDOWS)
-#include "SystemInfo.h"
 #endif
 
 namespace WebCore {
 
-#if OS(DARWIN) || OS(UNIX)
 static const char* cpuDescriptionForUAString()
 {
 #if CPU(PPC) || CPU(PPC64)
@@ -49,38 +46,16 @@
     return "Unknown";
 #endif
 }
-#endif
 
-static const char* platformForUAString()
-{
-#if PLATFORM(X11)
-    return "X11";
-#elif OS(WINDOWS)
-    return "";
-#elif PLATFORM(MAC)
-    return "Macintosh";
-#elif defined(GDK_WINDOWING_DIRECTFB)
-    return "DirectFB";
-#else
-    return "Unknown";
-#endif
-}
-
 static String platformVersionForUAString()
 {
     DEFINE_STATIC_LOCAL(String, uaOSVersion, (String()));
     if (!uaOSVersion.isEmpty())
         return uaOSVersion;
 
-#if OS(WINDOWS)
-    uaOSVersion = windowsVersionForUAString();
-#elif OS(DARWIN) || OS(UNIX)
     // We will always claim to be Safari in Mac OS X, since Safari in Linux triggers the iOS path on
     // some websites.
     uaOSVersion = String::format("%s Mac OS X", cpuDescriptionForUAString());
-#else
-    uaOSVersion = String("Unknown");
-#endif
     return uaOSVersion;
 }
 
@@ -95,9 +70,9 @@
     // wrong can cause sites to load the wrong _javascript_, CSS, or custom fonts. In some cases
     // sites won't load resources at all.
     DEFINE_STATIC_LOCAL(const CString, uaVersion, (String::format("%i.%i", USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION).utf8()));
-    DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (%s; %s) AppleWebKit/%s (KHTML, like Gecko) Safari/%s",
-                                                                platformForUAString(), platformVersionForUAString().utf8().data(),
-                                                                uaVersion.data(), uaVersion.data())));
+    DEFINE_STATIC_LOCAL(const String, staticUA, (String::format("Mozilla/5.0 (Macintosh; %s) AppleWebKit/%s (KHTML, like Gecko) Safari/%s",
+        platformVersionForUAString().utf8().data(), uaVersion.data(), uaVersion.data())));
+
     if (applicationName.isEmpty())
         return staticUA;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to