Skip to content

Conversation

@kenrussell
Copy link
Member

When ImageBitmapOptions is not supported by the browser, the implicit
behavior of the premultiplyAlpha option is the default. Per HTML
specification:

https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#cropped-to-the-source-rectangle-with-formatting

this is implementation-specific (either premultiplied or not), so when
the input ImageData has alpha != 1.0, there isn't a single correct
answer. Skip these tests.

This was discovered while implementing ImageBitmap from ImageData
support in WebKit in https://bugs.webkit.org/show_bug.cgi?id=183438 ,
though WebKit supports ImageBitmapOptions. Firefox currently doesn't
support ImageBitmapOptions and happens to have been passing these
tests, but WebKit wouldn't have.

When ImageBitmapOptions is not supported by the browser, the implicit
behavior of the premultiplyAlpha option is the default. Per HTML
specification:

https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#cropped-to-the-source-rectangle-with-formatting

this is implementation-specific (either premultiplied or not), so when
the input ImageData has alpha != 1.0, there isn't a single correct
answer. Skip these tests.

This was discovered while implementing ImageBitmap from ImageData
support in WebKit in https://bugs.webkit.org/show_bug.cgi?id=183438 ,
though WebKit supports ImageBitmapOptions. Firefox currently doesn't
support ImageBitmapOptions and happens to have been passing these
tests, but WebKit wouldn't have.
@kenrussell kenrussell requested review from grorg and kdashg August 4, 2020 20:10
@kenrussell
Copy link
Member Author

@jdashg @grorg in particular please review.

Copy link
Contributor

@grorg grorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@kdashg kdashg merged commit 272eb8d into KhronosGroup:master Aug 4, 2020
@kenrussell kenrussell deleted the disable-image-bitmap-from-image-data-non-alpha-1-tests branch August 4, 2020 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants