Title: [223392] releases/WebKitGTK/webkit-2.18/Source/WebCore
Revision
223392
Author
[email protected]
Date
2017-10-16 05:18:15 -0700 (Mon, 16 Oct 2017)

Log Message

Merge r222264 - [GTK] Completely garbled display in GMail
https://bugs.webkit.org/show_bug.cgi?id=168964

Reviewed by Carlos Garcia Campos.

Do not try to decode images that are bigger than 32768 pixels, as cairo won't be able to render them,
and they will break the rendering of the rest of the page.

Covered by existent tests.

* platform/graphics/ImageBackingStore.h:
(WebCore::ImageBackingStore::isOverSize):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog (223391 => 223392)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-10-16 12:16:25 UTC (rev 223391)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-10-16 12:18:15 UTC (rev 223392)
@@ -1,3 +1,18 @@
+2017-09-20  Miguel Gomez  <[email protected]>
+
+        [GTK] Completely garbled display in GMail
+        https://bugs.webkit.org/show_bug.cgi?id=168964
+
+        Reviewed by Carlos Garcia Campos.
+
+        Do not try to decode images that are bigger than 32768 pixels, as cairo won't be able to render them,
+        and they will break the rendering of the rest of the page.
+
+        Covered by existent tests.
+
+        * platform/graphics/ImageBackingStore.h:
+        (WebCore::ImageBackingStore::isOverSize):
+
 2017-09-19  Wenson Hsieh  <[email protected]>
 
         REGRESSION (r215613): Incorrect corners clipping with border-radius

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/graphics/ImageBackingStore.h (223391 => 223392)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/graphics/ImageBackingStore.h	2017-10-16 12:16:25 UTC (rev 223391)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/graphics/ImageBackingStore.h	2017-10-16 12:18:15 UTC (rev 223392)
@@ -33,6 +33,12 @@
 
 namespace WebCore {
 
+#if USE(CAIRO)
+// Due to the pixman 16.16 floating point representation, cairo is not able to handle
+// images whose size is bigger than 32768.
+static const int cairoMaxImageSize = 32768;
+#endif
+
 class ImageBackingStore {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -171,6 +177,14 @@
 
     static bool isOverSize(const IntSize& size)
     {
+#if USE(CAIRO)
+        // FIXME: this is a workaround to avoid the cairo image size limit, but we should implement support for
+        // bigger images. See https://bugs.webkit.org/show_bug.cgi?id=177227.
+        //
+        // If the image is bigger than the cairo limit it can't be displayed, so we don't even try to decode it.
+        if (size.width() > cairoMaxImageSize || size.height() > cairoMaxImageSize)
+            return true;
+#endif
         static unsigned long long MaxPixels = ((1 << 29) - 1);
         unsigned long long pixels = static_cast<unsigned long long>(size.width()) * static_cast<unsigned long long>(size.height());
         return pixels > MaxPixels;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to