<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[170636] releases/WebKitGTK/webkit-2.4</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/170636">170636</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-07-01 05:07:08 -0700 (Tue, 01 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/169799">r169799</a> - [GTK] Use a different user agent string depending on the site
https://bugs.webkit.org/show_bug.cgi?id=132681

Reviewed by Anders Carlsson.

Source/WebCore:
We have changed the user agent string several times to try to fix
broken websites that require specific things in the UA string to
properly work. But everytime we change the UA string to fix a
website we break others. We could use different UA string
depending on the website. UserAgentGtk code has also been cleaned
up, using NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
and avoiding unneeded conversions to UTF-8.

* platform/gtk/UserAgentGtk.cpp:
(WebCore::UserAgentQuirks::UserAgentQuirks): New helper private
class to handle user agent quirks.
(WebCore::UserAgentQuirks::add):
(WebCore::UserAgentQuirks::contains):
(WebCore::UserAgentQuirks::isEmpty):
(WebCore::platformForUAString): Bring back this method that was
removed to always pretend to be Macintosh.
(WebCore::platformVersionForUAString): Return a different platform
version depending on the actual platform.
(WebCore::versionForUAString): Return the WebKit version.
(WebCore::buildUserAgentString): Helper function to build the user
agent taking into account the UserAgentQuirks received.
(WebCore::standardUserAgentStatic): Standard user agent string
when no quirks are present.
(WebCore::standardUserAgent):
(WebCore::standardUserAgentForURL): New method that returns the
user agent string for the given URL.
* platform/gtk/UserAgentGtk.h:

Source/WebKit2:
* UIProcess/API/gtk/WebKitSettings.cpp:
(webkit_settings_class_init): Enable site specific quirks setting
by default.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::userAgent): Pass the given URL to WebPage.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::userAgent): Try to get the user agent for the
URL received falling back to the current one otherwise.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::platformUserAgent): Added.
* WebProcess/WebPage/efl/WebPageEfl.cpp:
(WebKit::WebPage::platformUserAgent): Return null String.
* WebProcess/WebPage/gtk/WebPageGtk.cpp:
(WebKit::WebPage::platformUserAgent): Use WebCore::standardUserAgentForURL() when site specific quirks
setting is enabled.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformUserAgent): Return null String.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::platformUserAgent): Return null String.

Tools:
Add a unit test to check user agent quirks.

* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp:
(testWebKitSettings): Site specific quirks setting is now enabled
by default.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit24SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebCoreplatformgtkUserAgentGtkcpp">releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebCoreplatformgtkUserAgentGtkh">releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.h</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebKit2ChangeLog">releases/WebKitGTK/webkit-2.4/Source/WebKit2/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebKit2UIProcessAPIgtkWebKitSettingscpp">releases/WebKitGTK/webkit-2.4/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPageWebPagecpp">releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPageWebPageh">releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPageeflWebPageEflcpp">releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPagegtkWebPageGtkcpp">releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPageiosWebPageIOSmm">releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsChangeLog">releases/WebKitGTK/webkit-2.4/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPIGNUmakefileam">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/GNUmakefile.am</a></li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkTestWebKitSettingscpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebCore/gtk/</li>
<li><a href="#releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebCoregtkUserAgentQuirkscpp">releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit24SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebCore/ChangeLog        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2014-06-11  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Use a different user agent string depending on the site
+        https://bugs.webkit.org/show_bug.cgi?id=132681
+
+        Reviewed by Anders Carlsson.
+
+        We have changed the user agent string several times to try to fix
+        broken websites that require specific things in the UA string to
+        properly work. But everytime we change the UA string to fix a
+        website we break others. We could use different UA string
+        depending on the website. UserAgentGtk code has also been cleaned
+        up, using NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
+        and avoiding unneeded conversions to UTF-8.
+
+        * platform/gtk/UserAgentGtk.cpp:
+        (WebCore::UserAgentQuirks::UserAgentQuirks): New helper private
+        class to handle user agent quirks.
+        (WebCore::UserAgentQuirks::add):
+        (WebCore::UserAgentQuirks::contains):
+        (WebCore::UserAgentQuirks::isEmpty):
+        (WebCore::platformForUAString): Bring back this method that was
+        removed to always pretend to be Macintosh.
+        (WebCore::platformVersionForUAString): Return a different platform
+        version depending on the actual platform.
+        (WebCore::versionForUAString): Return the WebKit version.
+        (WebCore::buildUserAgentString): Helper function to build the user
+        agent taking into account the UserAgentQuirks received.
+        (WebCore::standardUserAgentStatic): Standard user agent string
+        when no quirks are present.
+        (WebCore::standardUserAgent):
+        (WebCore::standardUserAgentForURL): New method that returns the
+        user agent string for the given URL.
+        * platform/gtk/UserAgentGtk.h:
+
</ins><span class="cx"> 2014-06-13  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Gtk] [Stable] Fix the &quot;Safari&quot; part of the UA
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebCoreplatformgtkUserAgentGtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.cpp (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.cpp        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.cpp        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Igalia S.L.
</del><ins>+ * Copyright (C) 2012, 2014 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,7 +26,9 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;UserAgentGtk.h&quot;
</span><span class="cx"> 
</span><del>-#include &lt;glib.h&gt;
</del><ins>+#include &quot;URL.h&quot;
+#include &lt;wtf/NeverDestroyed.h&gt;
+#include &lt;wtf/text/StringBuilder.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if OS(UNIX)
</span><span class="cx"> #include &lt;sys/utsname.h&gt;
</span><span class="lines">@@ -34,6 +36,39 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class UserAgentQuirks {
+public:
+    enum UserAgentQuirk {
+        NeedsMacintoshPlatform,
+
+        NumUserAgentQuirks
+    };
+
+    UserAgentQuirks()
+        : m_quirks(0)
+    {
+        COMPILE_ASSERT(sizeof(m_quirks) * 8 &gt;= NumUserAgentQuirks, not_enough_room_for_quirks);
+    }
+
+    void add(UserAgentQuirk quirk)
+    {
+        ASSERT(quirk &gt;= 0);
+        ASSERT_WITH_SECURITY_IMPLICATION(quirk &lt; NumUserAgentQuirks);
+
+        m_quirks |= (1 &lt;&lt; quirk);
+    }
+
+    bool contains(UserAgentQuirk quirk) const
+    {
+        return m_quirks &amp; (1 &lt;&lt; quirk);
+    }
+
+    bool isEmpty() const { return !m_quirks; }
+
+private:
+    uint32_t m_quirks;
+};
+
</ins><span class="cx"> static const char* cpuDescriptionForUAString()
</span><span class="cx"> {
</span><span class="cx"> #if CPU(PPC) || CPU(PPC64)
</span><span class="lines">@@ -47,18 +82,76 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static String platformVersionForUAString()
</del><ins>+static const char* platformForUAString()
</ins><span class="cx"> {
</span><del>-    DEFINE_STATIC_LOCAL(String, uaOSVersion, (String()));
-    if (!uaOSVersion.isEmpty())
-        return uaOSVersion;
</del><ins>+#if PLATFORM(X11)
+    return &quot;X11&quot;;
+#elif OS(WINDOWS)
+    return &quot;&quot;;
+#elif PLATFORM(MAC)
+    return &quot;Macintosh&quot;;
+#elif defined(GDK_WINDOWING_DIRECTFB)
+    return &quot;DirectFB&quot;;
+#else
+    return &quot;Unknown&quot;;
+#endif
+}
</ins><span class="cx"> 
</span><del>-    // 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(&quot;%s Mac OS X&quot;, cpuDescriptionForUAString());
</del><ins>+static const String platformVersionForUAString()
+{
+#if OS(UNIX)
+    struct utsname name;
+    uname(&amp;name);
+    static NeverDestroyed&lt;const String&gt; uaOSVersion(String::format(&quot;%s %s&quot;, name.sysname, name.machine));
</ins><span class="cx">     return uaOSVersion;
</span><ins>+#else
+    // We will always claim to be Safari in Mac OS X, since Safari in Linux triggers the iOS path on some websites.
+    static NeverDestroyed&lt;const String&gt; uaOSVersion(String::format(&quot;%s Mac OS X&quot;, cpuDescriptionForUAString()));
+    return uaOSVersion;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static const String versionForUAString()
+{
+    static NeverDestroyed&lt;const String&gt; uaVersion(String::format(&quot;%i.%i&quot;, USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION));
+    return uaVersion;
+}
+
+static String buildUserAgentString(const UserAgentQuirks&amp; quirks)
+{
+    StringBuilder uaString;
+    uaString.appendLiteral(&quot;Mozilla/5.0 &quot;);
+    uaString.append('(');
+
+    if (quirks.contains(UserAgentQuirks::NeedsMacintoshPlatform))
+        uaString.appendLiteral(&quot;Macintosh&quot;);
+    else
+        uaString.append(platformForUAString());
+
+    uaString.appendLiteral(&quot;; &quot;);
+
+    if (quirks.contains(UserAgentQuirks::NeedsMacintoshPlatform)) {
+        uaString.append(cpuDescriptionForUAString());
+        uaString.appendLiteral(&quot; Mac OS X&quot;);
+    } else
+        uaString.append(platformVersionForUAString());
+
+    uaString.appendLiteral(&quot;) AppleWebKit/&quot;);
+    uaString.append(versionForUAString());
+    // Version/X is mandatory *before* Safari/X to be a valid Safari UA. See
+    // https://bugs.webkit.org/show_bug.cgi?id=133403 for details.
+    uaString.appendLiteral(&quot; (KHTML, like Gecko) Version/8.0 Safari/&quot;);
+    uaString.append(versionForUAString());
+
+    return uaString.toString();
+}
+
+static const String standardUserAgentStatic()
+{
+    static NeverDestroyed&lt;const String&gt; uaStatic(buildUserAgentString(UserAgentQuirks()));
+    return uaStatic;
+}
+
</ins><span class="cx"> String standardUserAgent(const String&amp; applicationName, const String&amp; applicationVersion)
</span><span class="cx"> {
</span><span class="cx">     // Create a default user agent string with a liberal interpretation of
</span><span class="lines">@@ -69,19 +162,29 @@
</span><span class="cx">     // browsers that are &quot;Safari&quot; but not running on OS X are the Safari iOS browse. Getting this
</span><span class="cx">     // wrong can cause sites to load the wrong JavaScript, CSS, or custom fonts. In some cases
</span><span class="cx">     // sites won't load resources at all.
</span><del>-    DEFINE_STATIC_LOCAL(const CString, uaVersion, (String::format(&quot;%i.%i&quot;, USER_AGENT_GTK_MAJOR_VERSION, USER_AGENT_GTK_MINOR_VERSION).utf8()));
-    DEFINE_STATIC_LOCAL(const String, staticUA, (String::format(&quot;Mozilla/5.0 (Macintosh; %s) AppleWebKit/%s (KHTML, like Gecko) Version/8.0 Safari/%s&quot;,
-        platformVersionForUAString().utf8().data(), uaVersion.data(), uaVersion.data())));
-
</del><span class="cx">     if (applicationName.isEmpty())
</span><del>-        return staticUA;
</del><ins>+        return standardUserAgentStatic();
</ins><span class="cx"> 
</span><span class="cx">     String finalApplicationVersion = applicationVersion;
</span><span class="cx">     if (finalApplicationVersion.isEmpty())
</span><del>-        finalApplicationVersion = uaVersion.data();
</del><ins>+        finalApplicationVersion = versionForUAString();
</ins><span class="cx"> 
</span><del>-    return String::format(&quot;%s %s/%s&quot;, staticUA.utf8().data(), applicationName.utf8().data(), finalApplicationVersion.utf8().data());
</del><ins>+    return standardUserAgentStatic() + ' ' + applicationName + '/' + finalApplicationVersion;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String standardUserAgentForURL(const URL&amp; url)
+{
+    ASSERT(!url.isNull());
+    UserAgentQuirks quirks;
+    if (url.host().endsWith(&quot;.yahoo.com&quot;)) {
+        // www.yahoo.com redirects to the mobile version when Linux is present in the UA,
+        // use always Macintosh as platform. See https://bugs.webkit.org/show_bug.cgi?id=125444.
+        quirks.add(UserAgentQuirks::NeedsMacintoshPlatform);
+    }
+
+    // The null string means we don't need a specific UA for the given URL.
+    return quirks.isEmpty() ? String() : buildUserAgentString(quirks);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebCoreplatformgtkUserAgentGtkh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.h (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.h        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebCore/platform/gtk/UserAgentGtk.h        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Igalia S.L.
</del><ins>+ * Copyright (C) 2012, 2014 Igalia S.L.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,12 +26,13 @@
</span><span class="cx"> #ifndef UserAgentGtk_h
</span><span class="cx"> #define UserAgentGtk_h
</span><span class="cx"> 
</span><del>-#include &lt;wtf/text/CString.h&gt;
</del><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+class URL;
</ins><span class="cx"> 
</span><del>-String standardUserAgent(const String&amp; applicationName = &quot;&quot;, const String&amp; applicationVersion = &quot;&quot;);
</del><ins>+String standardUserAgent(const String&amp; applicationName = emptyString(), const String&amp; applicationVersion = emptyString());
+String standardUserAgentForURL(const URL&amp;);
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/ChangeLog (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/ChangeLog        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/ChangeLog        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-06-11  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Use a different user agent string depending on the site
+        https://bugs.webkit.org/show_bug.cgi?id=132681
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/gtk/WebKitSettings.cpp:
+        (webkit_settings_class_init): Enable site specific quirks setting
+        by default.
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::userAgent): Pass the given URL to WebPage.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::userAgent): Try to get the user agent for the
+        URL received falling back to the current one otherwise.
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::platformUserAgent): Added.
+        * WebProcess/WebPage/efl/WebPageEfl.cpp:
+        (WebKit::WebPage::platformUserAgent): Return null String.
+        * WebProcess/WebPage/gtk/WebPageGtk.cpp:
+        (WebKit::WebPage::platformUserAgent): Use WebCore::standardUserAgentForURL() when site specific quirks
+        setting is enabled.
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::platformUserAgent): Return null String.
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::platformUserAgent): Return null String.
+
</ins><span class="cx"> 2014-05-26  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] WebProcess leaked when closing pages with network process enabled
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebKit2UIProcessAPIgtkWebKitSettingscpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/UIProcess/API/gtk/WebKitSettings.cpp        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -1064,13 +1064,15 @@
</span><span class="cx">      * workarounds. By turning on site-specific quirks, WebKit will
</span><span class="cx">      * special-case this and other cases to make some specific sites work.
</span><span class="cx">      */
</span><del>-    g_object_class_install_property(gObjectClass,
-                                    PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
-                                    g_param_spec_boolean(&quot;enable-site-specific-quirks&quot;,
-                                                         _(&quot;Enable Site Specific Quirks&quot;),
-                                                         _(&quot;Enables the site-specific compatibility workarounds&quot;),
-                                                         FALSE,
-                                                         readWriteConstructParamFlags));
</del><ins>+    g_object_class_install_property(
+        gObjectClass,
+        PROP_ENABLE_SITE_SPECIFIC_QUIRKS,
+        g_param_spec_boolean(
+            &quot;enable-site-specific-quirks&quot;,
+            _(&quot;Enable Site Specific Quirks&quot;),
+            _(&quot;Enables the site-specific compatibility workarounds&quot;),
+            TRUE,
+            readWriteConstructParamFlags));
</ins><span class="cx"> 
</span><span class="cx">     /**
</span><span class="cx">      * WebKitSettings:enable-page-cache:
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -1146,13 +1146,13 @@
</span><span class="cx">         title.string(), url.string(), m_frame-&gt;frameID()), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-String WebFrameLoaderClient::userAgent(const URL&amp;)
</del><ins>+String WebFrameLoaderClient::userAgent(const URL&amp; url)
</ins><span class="cx"> {
</span><span class="cx">     WebPage* webPage = m_frame-&gt;page();
</span><span class="cx">     if (!webPage)
</span><span class="cx">         return String();
</span><span class="cx"> 
</span><del>-    return webPage-&gt;userAgent();
</del><ins>+    return webPage-&gt;userAgent(url);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame*)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -2169,6 +2169,15 @@
</span><span class="cx">     m_userAgent = userAgent;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String WebPage::userAgent(const URL&amp; url) const
+{
+    String userAgent = platformUserAgent(url);
+    if (!userAgent.isEmpty())
+        return userAgent;
+
+    return m_userAgent;
+}
+
</ins><span class="cx"> void WebPage::suspendActiveDOMObjectsAndAnimations()
</span><span class="cx"> {
</span><span class="cx">     m_page-&gt;suspendActiveDOMObjectsAndAnimations();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/WebPage.h (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -124,6 +124,7 @@
</span><span class="cx">     class SharedBuffer;
</span><span class="cx">     class SubstituteData;
</span><span class="cx">     class TextCheckingRequest;
</span><ins>+    class URL;
</ins><span class="cx">     class VisibleSelection;
</span><span class="cx">     struct KeypressCommand;
</span><span class="cx">     struct TextCheckingResult;
</span><span class="lines">@@ -227,7 +228,8 @@
</span><span class="cx">     void didCommitLoad(WebFrame*);
</span><span class="cx">     void didFinishLoad(WebFrame*);
</span><span class="cx">     void show();
</span><del>-    String userAgent() const { return m_userAgent; }
</del><ins>+    String userAgent(const WebCore::URL&amp;) const;
+    String platformUserAgent(const WebCore::URL&amp;) const;
</ins><span class="cx">     WebCore::IntRect windowResizerRect() const;
</span><span class="cx">     WebCore::KeyboardUIMode keyboardUIMode();
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPageeflWebPageEflcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/efl/WebPageEfl.cpp        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -220,4 +220,9 @@
</span><span class="cx">     frame.editor().cancelComposition();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String WebPage::platformUserAgent(const URL&amp;) const
+{
+    return String();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPagegtkWebPageGtkcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/gtk/WebPageGtk.cpp        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &lt;WebCore/PasteboardHelper.h&gt;
</span><span class="cx"> #include &lt;WebCore/PlatformKeyboardEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/Settings.h&gt;
</span><ins>+#include &lt;WebCore/UserAgentGtk.h&gt;
</ins><span class="cx"> #include &lt;wtf/gobject/GUniquePtr.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -168,4 +169,12 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+String WebPage::platformUserAgent(const URL&amp; url) const
+{
+    if (url.isNull() || !m_page-&gt;settings().needsSiteSpecificQuirks())
+        return String();
+
+    return WebCore::standardUserAgentForURL(url);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24SourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -877,4 +877,9 @@
</span><span class="cx">     m_page-&gt;setPageScaleFactor(newScale, m_page-&gt;mainFrame().view()-&gt;scrollPosition());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String WebPage::platformUserAgent(const URL&amp;) const
+{
+    return String();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/ChangeLog (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/ChangeLog        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Tools/ChangeLog        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-06-11  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Use a different user agent string depending on the site
+        https://bugs.webkit.org/show_bug.cgi?id=132681
+
+        Reviewed by Anders Carlsson.
+
+        Add a unit test to check user agent quirks.
+
+        * TestWebKitAPI/PlatformGTK.cmake:
+        * TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp: Added.
+        (TestWebKitAPI::TEST):
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp:
+        (testWebKitSettings): Site specific quirks setting is now enabled
+        by default.
+
</ins><span class="cx"> 2014-06-13  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Gtk] [Stable] Fix the &quot;Safari&quot; part of the UA
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPIGNUmakefileam"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/GNUmakefile.am (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/GNUmakefile.am        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/GNUmakefile.am        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -112,8 +112,7 @@
</span><span class="cx"> noinst_PROGRAMS += \
</span><span class="cx">         Programs/TestWebKitAPI/WTF/TestWTF \
</span><span class="cx">         Programs/TestWebKitAPI/JavaScriptCore/TestJavaScriptCore \
</span><del>-        Programs/TestWebKitAPI/WebCore/TestWebCore \
-        Programs/TestWebKitAPI/WebCoreGtk/TestWebCoreGtk
</del><ins>+        Programs/TestWebKitAPI/WebCore/TestWebCore
</ins><span class="cx"> 
</span><span class="cx"> if ENABLE_WEBKIT1
</span><span class="cx"> noinst_PROGRAMS += \
</span><span class="lines">@@ -285,8 +284,10 @@
</span><span class="cx"> 
</span><span class="cx"> Programs_TestWebKitAPI_WebCore_TestWebCore_CPPFLAGS = \
</span><span class="cx">         $(Libraries_libTestWebKitAPIMain_la_CPPFLAGS) \
</span><del>-        -I$(srcdir)/Source/WebCore/platform/network/soup \
-        -I$(top_builddir)/DerivedSources/WebCore/include \
</del><ins>+        $(platform_cppflags) \
+        $(platformgtk_cppflags) \
+        $(webcore_cppflags) \
+        $(webcoregtk_cppflags) \
</ins><span class="cx">         $(LIBSOUP_CFLAGS)
</span><span class="cx"> 
</span><span class="cx"> Programs_TestWebKitAPI_WebCore_TestWebCore_CXXFLAGS = \
</span><span class="lines">@@ -324,40 +325,6 @@
</span><span class="cx">         -no-install
</span><span class="cx"> 
</span><span class="cx"> Programs_TestWebKitAPI_WebCore_TestWebCore_SOURCES = \
</span><del>-        Tools/TestWebKitAPI/Tests/WebCore/URL.cpp \
-        Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp
-
-Programs_TestWebKitAPI_WebCoreGtk_TestWebCoreGtk_CPPFLAGS = \
-        $(Programs_TestWebKitAPI_WTF_TestWTF_CPPFLAGS) \
-        $(platform_cppflags) \
-        $(platformgtk_cppflags) \
-        $(webcore_cppflags) \
-        $(webcoregtk_cppflags) \
-        $(FREETYPE_CFLAGS) \
-        $(GLIB_CFLAGS) \
-        $(GTK_CFLAGS) \
-        $(LIBSOUP_CFLAGS)
-
-Programs_TestWebKitAPI_WebCoreGtk_TestWebCoreGtk_CXXFLAGS = \
-        -DGTEST_HAS_RTTI=0 \
-        $(global_cxxflags)
-
-Programs_TestWebKitAPI_WebCoreGtk_TestWebCoreGtk_LDADD = \
-        Libraries/libTestWebKitAPIMain.la \
-        Libraries/libgtest.la \
-        libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
-        libPlatformGtk.la \
-        libWebCore.la \
-        libWebCoreGtk.la \
-        $(FREETYPE_LIBS) \
-        $(GLIB_LIBS) \
-        $(GTK_LIBS) \
-        $(LIBSOUP_LIBS)
-
-Programs_TestWebKitAPI_WebCoreGtk_TestWebCoreGtk_LDFLAGS = \
-        $(Programs_TestWebKitAPI_WTF_TestWTF_LDFLAGS)
-
-Programs_TestWebKitAPI_WebCoreGtk_TestWebCoreGtk_SOURCES = \
</del><span class="cx">         Source/WebCore/platform/graphics/IntPoint.cpp \
</span><span class="cx">         Source/WebCore/platform/graphics/IntRect.cpp \
</span><span class="cx">         Source/WebCore/platform/graphics/IntSize.cpp \
</span><span class="lines">@@ -365,7 +332,10 @@
</span><span class="cx">         Source/WebCore/platform/graphics/gtk/IntRectGtk.cpp \
</span><span class="cx">         Source/WebCore/platform/gtk/GtkInputMethodFilter.cpp \
</span><span class="cx">         Tools/TestWebKitAPI/config.h \
</span><del>-        Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp
</del><ins>+        Tools/TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp \
+        Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp \
+        Tools/TestWebKitAPI/Tests/WebCore/URL.cpp \
+        Tools/TestWebKitAPI/Tests/WebCore/LayoutUnit.cpp
</ins><span class="cx"> 
</span><span class="cx"> Programs_TestWebKitAPI_WebKitGtk_testapplicationcache_SOURCES = \
</span><span class="cx">         Tools/TestWebKitAPI/Tests/WebKitGtk/testapplicationcache.c
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebCoregtkUserAgentQuirkscpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp (0 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp                                (rev 0)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebCore/gtk/UserAgentQuirks.cpp        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2014 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#include &lt;WebCore/URL.h&gt;
+#include &lt;WebCore/UserAgentGtk.h&gt;
+
+using namespace WebCore;
+
+namespace TestWebKitAPI {
+
+TEST(WebCore, UserAgentQuirksTest)
+{
+    // A site with not quirks should return a null String.
+    String uaString = standardUserAgentForURL(URL(ParsedURLString, &quot;http://www.webkit.org/&quot;));
+    EXPECT_TRUE(uaString.isNull());
+
+    // www.yahoo.com requires MAC OS platform in the UA.
+    uaString = standardUserAgentForURL(URL(ParsedURLString, &quot;http://www.yahoo.com/&quot;));
+    EXPECT_TRUE(uaString.contains(&quot;Macintosh&quot;));
+    EXPECT_TRUE(uaString.contains(&quot;Mac OS X&quot;));
+    EXPECT_FALSE(uaString.contains(&quot;Linux&quot;));
+}
+
+} // namespace TestWebKitAPI
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit24ToolsTestWebKitAPITestsWebKit2GtkTestWebKitSettingscpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp (170635 => 170636)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp        2014-07-01 11:32:36 UTC (rev 170635)
+++ releases/WebKitGTK/webkit-2.4/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitSettings.cpp        2014-07-01 12:07:08 UTC (rev 170636)
</span><span class="lines">@@ -233,10 +233,10 @@
</span><span class="cx">     webkit_settings_set_draw_compositing_indicators(settings, TRUE);
</span><span class="cx">     g_assert(webkit_settings_get_draw_compositing_indicators(settings));
</span><span class="cx"> 
</span><del>-    // By default, site specific quirks are disabled.
</del><ins>+    // By default, site specific quirks are enabled.
+    g_assert(webkit_settings_get_enable_site_specific_quirks(settings));
+    webkit_settings_set_enable_site_specific_quirks(settings, FALSE);
</ins><span class="cx">     g_assert(!webkit_settings_get_enable_site_specific_quirks(settings));
</span><del>-    webkit_settings_set_enable_site_specific_quirks(settings, TRUE);
-    g_assert(webkit_settings_get_enable_site_specific_quirks(settings));
</del><span class="cx"> 
</span><span class="cx">     // By default, page cache is enabled.
</span><span class="cx">     g_assert(webkit_settings_get_enable_page_cache(settings));
</span></span></pre>
</div>
</div>

</body>
</html>