Title: [232113] trunk
Revision
232113
Author
[email protected]
Date
2018-05-23 09:09:54 -0700 (Wed, 23 May 2018)

Log Message

Page keeps reloading when viewing photos in google drive (due to too high canvas memory limits)
https://bugs.webkit.org/show_bug.cgi?id=185903
<rdar://problem/38420562>

Reviewed by Simon Fraser.

Source/WebCore:

The canvas memory usage limits don't work on iOS since the current 2GB minimum limit is
larger than the maximum process size.

* html/HTMLCanvasElement.cpp:
(WebCore::maxActivePixelMemory):

Always base this on the reported ramSize() on iOS. Make it still fairly large to not risk breaking
any currently working content. In practice the limit computes to 448MB on device at the moment.

LayoutTests:

* platform/ios-simulator/fast/canvas/canvas-crash-expected.txt:
* platform/ios-simulator/fast/canvas/canvas-skia-excessive-size-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (232112 => 232113)


--- trunk/LayoutTests/ChangeLog	2018-05-23 15:33:49 UTC (rev 232112)
+++ trunk/LayoutTests/ChangeLog	2018-05-23 16:09:54 UTC (rev 232113)
@@ -1,3 +1,14 @@
+2018-05-23  Antti Koivisto  <[email protected]>
+
+        Page keeps reloading when viewing photos in google drive (due to too high canvas memory limits)
+        https://bugs.webkit.org/show_bug.cgi?id=185903
+        <rdar://problem/38420562>
+
+        Reviewed by Simon Fraser.
+
+        * platform/ios-simulator/fast/canvas/canvas-crash-expected.txt:
+        * platform/ios-simulator/fast/canvas/canvas-skia-excessive-size-expected.txt: Added.
+
 2018-05-22  Manuel Rego Casasnovas  <[email protected]>
 
         [css-text] W3C test suite gardening

Modified: trunk/LayoutTests/platform/ios-simulator/fast/canvas/canvas-crash-expected.txt (232112 => 232113)


--- trunk/LayoutTests/platform/ios-simulator/fast/canvas/canvas-crash-expected.txt	2018-05-23 15:33:49 UTC (rev 232112)
+++ trunk/LayoutTests/platform/ios-simulator/fast/canvas/canvas-crash-expected.txt	2018-05-23 16:09:54 UTC (rev 232113)
@@ -1,2 +1,3 @@
-CONSOLE MESSAGE: line 16: Canvas area exceeds the maximum limit (width * height > 16777216).
-PASSED 
+CONSOLE MESSAGE: line 15: Total canvas memory use exceeds the maximum limit (256 MB).
+CONSOLE MESSAGE: line 16: TypeError: null is not an object (evaluating 'ctx.putImageData')
+

Added: trunk/LayoutTests/platform/ios-simulator/fast/canvas/canvas-skia-excessive-size-expected.txt (0 => 232113)


--- trunk/LayoutTests/platform/ios-simulator/fast/canvas/canvas-skia-excessive-size-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/canvas/canvas-skia-excessive-size-expected.txt	2018-05-23 16:09:54 UTC (rev 232113)
@@ -0,0 +1,6 @@
+CONSOLE MESSAGE: line 20: Total canvas memory use exceeds the maximum limit (256 MB).
+This test checks to see if the browser survives the attempted creation of an excessively large canvas.
+
+Canvas 2d context = null!
+Survived canvas creation attempt. Width = 134217728
+

Modified: trunk/Source/WebCore/ChangeLog (232112 => 232113)


--- trunk/Source/WebCore/ChangeLog	2018-05-23 15:33:49 UTC (rev 232112)
+++ trunk/Source/WebCore/ChangeLog	2018-05-23 16:09:54 UTC (rev 232113)
@@ -1,3 +1,20 @@
+2018-05-23  Antti Koivisto  <[email protected]>
+
+        Page keeps reloading when viewing photos in google drive (due to too high canvas memory limits)
+        https://bugs.webkit.org/show_bug.cgi?id=185903
+        <rdar://problem/38420562>
+
+        Reviewed by Simon Fraser.
+
+        The canvas memory usage limits don't work on iOS since the current 2GB minimum limit is
+        larger than the maximum process size.
+
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::maxActivePixelMemory):
+
+        Always base this on the reported ramSize() on iOS. Make it still fairly large to not risk breaking
+        any currently working content. In practice the limit computes to 448MB on device at the moment.
+
 2018-05-23  Zalan Bujtas  <[email protected]>
 
         [LFC] Implement positioning for replaced out-of-flow elements

Modified: trunk/Source/WebCore/html/HTMLCanvasElement.cpp (232112 => 232113)


--- trunk/Source/WebCore/html/HTMLCanvasElement.cpp	2018-05-23 15:33:49 UTC (rev 232112)
+++ trunk/Source/WebCore/html/HTMLCanvasElement.cpp	2018-05-23 16:09:54 UTC (rev 232113)
@@ -196,7 +196,11 @@
     static size_t maxPixelMemory;
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [] {
+#if PLATFORM(IOS)
+        maxPixelMemory = ramSize() / 2;
+#else
         maxPixelMemory = std::max(ramSize() / 4, 2151 * MB);
+#endif
     });
     return maxPixelMemory;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to