new ImageData(1 << 31, 1 << 31); returns in Safari TP160 rangeerror: Cannot allocate a buffer of this size while it returns Firefox: Uncaught DOMException: Index or size is negative or greater than the allowed amount Chrome: Uncaught DOMException: Failed to construct 'ImageData': The requested image size exceeds the supported range. See https://searchfox.org/wubkat/rev/12fc92585a259a29b2522e7e902492be45a57b6a/Source/WebCore/html/ImageData.cpp#87-123 This is expected to pass http://wpt.live/html/canvas/element/pixel-manipulation/2d.imageData.object.ctor.basics.html https://wpt.fyi/results/html/canvas/element/pixel-manipulation/2d.imageData.object.ctor.basics.html
<rdar://problem/104461776>
I think this is a bug in Chromium and Gecko. https://html.spec.whatwg.org/#initialize-an-imagedata-object quite clearly states to reuse the RangeError exception for OOM. I guess 1 << 31 somehow ends up being treated as a positive integer due to IDL? That's the one thing I'm not totally clear on.