Bug 250659 - ImageData object must initialize to source when the source is provided
Summary: ImageData object must initialize to source when the source is provided
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: https://wpt.fyi/results/html/canvas/e...
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2023-01-15 18:25 PST by Karl Dubost
Modified: 2023-01-15 18:26 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>