Spotted on Twitter [1], by Rik Schennink “Safari 15 has a canvas memory limit of 4096 × 4096 pixels where Safari 14 could deal with resolutions up to 16384 x 16384” Can verify via the CodePen Demo [2] Rik also shared, in which he creates a 4097x4097 canvas. Upon calling `ctx.getImageData(0, 0, size, size)` the code fails. “Unable to get image data from canvas. Requested size was 4097 x 4097” While searching for bugs I did find [3] where the limit was added for iOS, but this is now applied on macOS too apparently. Is this a regression? [1] https://twitter.com/rikschennink/status/1442443774748082185 [2] https://codepen.io/rikschennink/pen/YzQRdwZ [3] https://bugs.webkit.org/show_bug.cgi?id=145998
I read in https://bugs.webkit.org/show_bug.cgi?id=229237 that the “2D memory limit” test got marked as expected to Crash, so I guess that that explains why this went undetected?
Update: Creating a canvas of 16384 x 16384 on macOS and drawing on it still works. It's only when calling `ctx.getImageData` that Safari fails to cooperate.
Thank you for filing. The appropriate engineers have been notified.
<rdar://problem/83671710>
<rdar://problem/83575501>
static const float MaxClampedLength = 4096; static const float MaxClampedArea = MaxClampedLength * MaxClampedLength;
Might have been caused by https://bugs.webkit.org/show_bug.cgi?id=144335?
Or by the GPU Process?