Bug 250659

Summary: ImageData object must initialize to source when the source is provided
Product: WebKit Reporter: Karl Dubost <karlcow>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dino, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar, WPTImpact
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
URL: https://wpt.fyi/results/html/canvas/element/pixel-manipulation/2d.imageData.object.ctor.array.html?label=experimental&label=master&aligned

Description Karl Dubost 2023-01-15 18:25:54 PST
Test to reproduce the issue

var array = new Uint8ClampedArray(8);
var imgdata = new window.ImageData(array, 1, 2);
imgdata.data === array;


This returns false in Safari
and true in Firefox and Chrome.

The spec says:

> If source was given, then initialize the data attribute of imageData to source.https://html.spec.whatwg.org/multipage/canvas.html#initialize-an-imagedata-object


This makes Safari fail
https://github.com/web-platform-tests/wpt/blob/7a0b0c285b91a0b1fa08da58c964b82e5cf40733/html/canvas/element/pixel-manipulation/2d.imageData.object.ctor.array.html#L28
https://wpt.fyi/results/html/canvas/element/pixel-manipulation/2d.imageData.object.ctor.array.html?label=experimental&label=master&aligned
Comment 1 Radar WebKit Bug Importer 2023-01-15 18:26:05 PST
<rdar://problem/104284100>