-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dom/html: ImageData browser compatibility #2535
Comments
This comment was originally written by @bp74 Chrome 18 + Firefox 12 are working with Uint8ClampedArray. Dart Editor Build 7066. |
This comment was originally written by @bp74 Looks like r7299 fixed it! |
Thanks for verifying, Bernhard. I'm leaving this bug open to track the problem with the type of the returned ImageData object: Chrome: FireFox 11: |
This comment was originally written by @bp74 With dart2js (build 8350) this issue is back. |
Hi Stephen. Do you have any insights into what's happening here? cc @rakudrama. |
Yes, see the initial report 'comment #0'. |
Set owner to @rakudrama. |
Fixed r11193 Added Fixed label. |
ImageData is different on different browsers:
var image = context2d.createImageData(100, 200);
Chrome:
image is an ImageData object
image.data member is a CanvasPixelArray
FireFox 11:
image is a raw Object: {width: 100, height: 200, data: xxx}
image.data is a Uint8ClampedArray
We can wrap the image data to ensure the FF version is a valid Dart object. This would be a bit painful since it is also an input and would need to be unwrapped. Since the FF version is a raw object, presumably any object with the three properties would do - we could create a native class that has them but also has a prototype to attach Dart methods.
Not sure what to do to about .data property. To generate good code, dart2js would need to know that this has one of two disjoint types which have 'compatible' native methods.
Next action: explore other browsers.
The text was updated successfully, but these errors were encountered: