[blink-dev] Intent to ship: ImageBitmap and createImageBitmap

100 views
Skip to first unread message

Xida Chen

unread,
Jan 13, 2016, 8:15:00 AM1/13/16
to blin...@chromium.org

Contact emails

xida...@chromium.org, ju...@chromium.org, k...@chromium.org


Spec

https://html.spec.whatwg.org/#imagebitmapfactories


Summary

An ImageBitmap object represents a bitmap image that can be painted to a canvas without undue latency. An ImageBitmap object can be obtained from a variety of different objects, using the createImageBitmap() method.


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/ImageBitmap/blink-dev/4xQWqlTfmLI/Ao5A9d72qpsJ


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Demo link

No demos. But the developers can turn on experimental canvas features flag in browser to try this feature.


Debuggability

This feature does not require special debugging support on its own.


Interoperability and Compatibility Risk

Interoperability risk is low. Firefox has release this feature in version 42 (https://developer.mozilla.org/en-US/Firefox/Releases/42). Other browsers have no public signals yet. Compatibility risk is low, as this does not remove or change existing features.


OWP launch tracking bug

http://crbug.com/249384


Entry on the feature dashboard

https://www.chromestatus.com/features#imagebitmap

smaug

unread,
Jan 13, 2016, 8:51:04 AM1/13/16
to Xida Chen, blink-dev


I was reviewing the API parts of ImageBitmap for Gecko and I quickly now tested something on blink, and
I can't see ImageBitmap interface object anywhere in the Worker scope in blink.
In Gecko it is there. And per spec it should be there.


http://mozilla.pettay.fi/workerconsole/
Type ImageBitmap to the first textarea and the latter textarea should show the result of the contents of the first textarea
executed in workers.
But, oddly enough createImageBitmap seems to be exposed in workers.





-Olli



On 01/13/2016 03:14 PM, Xida Chen wrote:
> Contact emails
>
> xida...@chromium.org <mailto:xida...@chromium.org>, ju...@chromium.org <mailto:ju...@chromium.org>, k...@chromium.org <mailto:k...@chromium.org>
> Entry on the feature dashboard <http://www.chromestatus.com/>
>
> https://www.chromestatus.com/features#imagebitmap
>
> --
> You received this message because you are subscribed to the Google Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.

Xida Chen

unread,
Jan 13, 2016, 9:24:54 AM1/13/16
to smaug, blink-dev
Currently ImageBitmap is not exposed to worker yet, but it is work in progress. It will be exposed to worker during the shipping process.


Sincerely
Xida Chen

Software Engineer
Canada-Waterloo

Chris Harrelson

unread,
Jan 13, 2016, 11:28:22 AM1/13/16
to Xida Chen, smaug, blink-dev
LGTM1 to ship.

I assume that you have checked and the behavior matches Firefox? Are there any shared compatibility layout tests in place to enforce this and avoid regressions?

Please double check that createImageBitmap is not accidentally shipped in workers, per Olli's comment above comment.

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Xida Chen

unread,
Jan 13, 2016, 1:02:59 PM1/13/16
to Chris Harrelson, smaug, blink-dev
Hi Chris,

The behavior of createImageBitmap and ImageBitmap matches Firefox. I don't think there are compatibility layout tests shared among different browser vendors for ImageBitmap, but I will try to find Firefox's ImageBitmap layout tests and run them against Chrome to make sure that they would all pass.

At this moment, createImageBitmap is exposed to worker scope and is hiding behind the --experimental-canvas-feature flag, while ImageBitmap is not exposed to worker scope but was accidentally shipped a while ago. So to make things less complicated, we decided that we will remove the flag for createImageBitmap, and make ImageBitmap expose to worker during the shipping process. 

Hope that makes sense.

Justin Novosad

unread,
Jan 13, 2016, 1:06:17 PM1/13/16
to Xida Chen, Chris Harrelson, smaug, blink-dev
On Wed, Jan 13, 2016 at 1:02 PM, Xida Chen <xida...@chromium.org> wrote:
 I will try to find Firefox's ImageBitmap layout tests and run them against Chrome to make sure that they would all pass.


And also vice versa (run our tests in Firefox)

Majid Valipour

unread,
Jan 13, 2016, 1:17:05 PM1/13/16
to Justin Novosad, Xida Chen, Chris Harrelson, smaug, blink-dev
Even better if these tests are added to web-platform-tests. It will perhaps 
require some work to move to update them to use their test harness but it will be valuable to do given that these are really spec tests.

Majid
 

Xida Chen

unread,
Jan 14, 2016, 2:39:18 PM1/14/16
to Justin Novosad, Chris Harrelson, smaug, blink-dev
I have run Chrome's layout tests for ImageBitmap under Firefox and vice versa, the result of that is:
1). Added two layout test cases to Chrome code base. See https://codereview.chromium.org/1589923002/
2). Filed a bug under mozilla bugzilla. See https://bugzilla.mozilla.org/show_bug.cgi?id=1239752

Rick Byers

unread,
Jan 15, 2016, 1:30:41 PM1/15/16
to Xida Chen, Justin Novosad, Chris Harrelson, smaug, blink-dev
To clarify, this intent covers shipping ImageBitmap and createImageBitmap on both Window and WorkerGlobalScope.  The "work in progress" is just a tiny CL to expose the APIs, but things were complicated / messy because a long time ago the ImageBitmap constructor was accidentally shipped on WorkerGlobalScope.  See https://codereview.chromium.org/1486663002/ for details.

LGTM2 to ship.

+1 to trying to get some shared tests into web-platform-tests - I'd like to get to the point where that's a standard thing we ask about for all intents (but the tooling / process probably isn't there yet, so I don't think we should consider it a requirement yet).




Justin Novosad

unread,
Jan 17, 2016, 12:43:30 AM1/17/16
to Rick Byers, Xida Chen, Chris Harrelson, smaug, blink-dev
On Fri, Jan 15, 2016 at 1:30 PM, Rick Byers <rby...@chromium.org> wrote:
To clarify, this intent covers shipping ImageBitmap and createImageBitmap on both Window and WorkerGlobalScope.  The "work in progress" is just a tiny CL to expose the APIs, but things were complicated / messy because a long time ago the ImageBitmap constructor was accidentally shipped on WorkerGlobalScope.  See https://codereview.chromium.org/1486663002/ for details.

LGTM2 to ship.

+1 to trying to get some shared tests into web-platform-tests - I'd like to get to the point where that's a standard thing we ask about for all intents (but the tooling / process probably isn't there yet, so I don't think we should consider it a requirement yet).

web-platform-tests is a W3C repository. ImageBitmap is not in any W3C specification. It only appears in the WHATWG specification, as far as I know. 

Anne van Kesteren

unread,
Jan 17, 2016, 2:05:44 AM1/17/16
to Justin Novosad, Rick Byers, Xida Chen, Chris Harrelson, smaug, blink-dev
On Sun, Jan 17, 2016 at 6:43 AM, Justin Novosad <ju...@chromium.org> wrote:
> web-platform-tests is a W3C repository. ImageBitmap is not in any W3C
> specification. It only appears in the WHATWG specification, as far as I
> know.

Just like browsers, wpt follows WHATWG over W3C, so that shouldn't be a problem.


--
https://annevankesteren.nl/

Mike Lawther

unread,
Jan 17, 2016, 6:26:48 PM1/17/16
to Anne van Kesteren, Justin Novosad, Rick Byers, Xida Chen, Chris Harrelson, smaug, blink-dev
Aside - does WHATWG have an accepted/reviewed set of tests that we could import/contribute to? My reading of https://wiki.whatwg.org/wiki/Testsuite is that it does not.




Domenic Denicola

unread,
Jan 17, 2016, 6:31:18 PM1/17/16
to Mike Lawther, Anne van Kesteren, Justin Novosad, Rick Byers, Xida Chen, Chris Harrelson, smaug, blink-dev, James Graham
From: mikel...@google.com [mailto:mikel...@google.com] On Behalf Of Mike Lawther

> Aside - does WHATWG have an accepted/reviewed set of tests that we could import/contribute to?

Web platform tests is the shared repository for all, well, web platform tests. It doesn't matter who wrote the spec, or whether the spec has been copy-and-pasted into w3.org or not.

Ideally WPT would move to its own GitHub organization to avoid this kind of confusion. That would also make it easier to find all the related supporting repos. But I imagine that is politically difficult.

> My reading of https://wiki.whatwg.org/wiki/Testsuite is that it does not.

This appears to be a page from the days of yore, when the Web Applications 1.0 effort was just starting and the idea that maybe we should test actual browser behavior was being floated. I'll update it to get rid of old information, but it would be great if someone intimately familiar with WPT (+James?) could update it further.

Justin Novosad

unread,
Jan 18, 2016, 11:43:23 AM1/18/16
to Domenic Denicola, Mike Lawther, Anne van Kesteren, Rick Byers, Xida Chen, Chris Harrelson, smaug, blink-dev, James Graham
+1 to referencing WPT at https://wiki.whatwg.org/wiki/Testsuite 
Like Mike, I landed on that page as well (from a web search), and it confused me.

Philip Jägenstedt

unread,
Jan 19, 2016, 10:21:43 AM1/19/16
to Rick Byers, Xida Chen, Justin Novosad, Chris Harrelson, smaug, blink-dev
LGTM3
Reply all
Reply to author
Forward
0 new messages