Title: [227965] trunk
Revision
227965
Author
[email protected]
Date
2018-02-01 07:55:14 -0800 (Thu, 01 Feb 2018)

Log Message

[GTK] Problem with Washington Post images
https://bugs.webkit.org/show_bug.cgi?id=181421

Reviewed by Carlos Alberto Lopez Perez.

Source/WebCore:

This is because Washington Post is using the user agent to decide the image formats it serves. In the case of
chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and
it's providing jp2 images that we don't support. Add a user agent quirk to pretend to be chromium for
washingtonpost.com.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):

Tools:

Add test case for the new user agent quirk.

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (227964 => 227965)


--- trunk/Source/WebCore/ChangeLog	2018-02-01 15:53:42 UTC (rev 227964)
+++ trunk/Source/WebCore/ChangeLog	2018-02-01 15:55:14 UTC (rev 227965)
@@ -1,5 +1,20 @@
 2018-02-01  Carlos Garcia Campos  <[email protected]>
 
+        [GTK] Problem with Washington Post images
+        https://bugs.webkit.org/show_bug.cgi?id=181421
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        This is because Washington Post is using the user agent to decide the image formats it serves. In the case of
+        chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and
+        it's providing jp2 images that we don't support. Add a user agent quirk to pretend to be chromium for
+        washingtonpost.com.
+
+        * platform/UserAgentQuirks.cpp:
+        (WebCore::urlRequiresChromeBrowser):
+
+2018-02-01  Carlos Garcia Campos  <[email protected]>
+
         [SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup
         https://bugs.webkit.org/show_bug.cgi?id=182328
 

Modified: trunk/Source/WebCore/platform/UserAgentQuirks.cpp (227964 => 227965)


--- trunk/Source/WebCore/platform/UserAgentQuirks.cpp	2018-02-01 15:53:42 UTC (rev 227964)
+++ trunk/Source/WebCore/platform/UserAgentQuirks.cpp	2018-02-01 15:55:14 UTC (rev 227965)
@@ -67,6 +67,12 @@
     if (baseDomain == "typekit.net" || baseDomain == "typekit.com")
         return true;
 
+    // Washington Post decides the image type based on the user agent,
+    // giving image/jp2 with WebKitGTK+'s standard user agent.
+    // https://bugs.webkit.org/show_bug.cgi?id=181421
+    if (baseDomain == "washingtonpost.com")
+        return true;
+
     return false;
 }
 

Modified: trunk/Tools/ChangeLog (227964 => 227965)


--- trunk/Tools/ChangeLog	2018-02-01 15:53:42 UTC (rev 227964)
+++ trunk/Tools/ChangeLog	2018-02-01 15:55:14 UTC (rev 227965)
@@ -1,5 +1,17 @@
 2018-02-01  Carlos Garcia Campos  <[email protected]>
 
+        [GTK] Problem with Washington Post images
+        https://bugs.webkit.org/show_bug.cgi?id=181421
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        Add test case for the new user agent quirk.
+
+        * TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
+        (TestWebKitAPI::TEST):
+
+2018-02-01  Carlos Garcia Campos  <[email protected]>
+
         [GTK] MiniBrowser settings are just a list of names
         https://bugs.webkit.org/show_bug.cgi?id=182005
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp (227964 => 227965)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp	2018-02-01 15:53:42 UTC (rev 227964)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp	2018-02-01 15:55:14 UTC (rev 227965)
@@ -80,6 +80,7 @@
 
     assertUserAgentForURLHasChromeBrowserQuirk("http://typekit.com/");
     assertUserAgentForURLHasChromeBrowserQuirk("http://typekit.net/");
+    assertUserAgentForURLHasChromeBrowserQuirk("http://www.washingtonpost.com");
 
     assertUserAgentForURLHasLinuxPlatformQuirk("http://www.google.com/");
     assertUserAgentForURLHasLinuxPlatformQuirk("http://www.google.es/");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to