Navigation Menu

Skip to content
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

[missing] Expose Window.createImageBitmap #12379

Open
vsmenon opened this issue Aug 12, 2013 · 19 comments
Open

[missing] Expose Window.createImageBitmap #12379

vsmenon opened this issue Aug 12, 2013 · 19 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. library-html P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-libraries Issues impacting dart:html, etc., libraries

Comments

@vsmenon
Copy link
Member

vsmenon commented Aug 12, 2013

This popped up in the last Blink IDL roll with 12 overloads. I hid it for now. We need to determine what names to expose the different variants under.

@vsmenon
Copy link
Member Author

vsmenon commented Aug 12, 2013

Here are the entries in Window.idl:

    // Images
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(HTMLImageElement image, ImageBitmapCall
back callback);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(HTMLImageElement image, ImageBitmapCall
back callback, long sx, long sy, long sw, long sh);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(HTMLVideoElement video, ImageBitmapCall
back callback);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(HTMLVideoElement video, ImageBitmapCall
back callback, long sx, long sy, long sw, long sh);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(CanvasRenderingContext2D context, Image
BitmapCallback callback);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(CanvasRenderingContext2D context, Image
BitmapCallback callback, long sx, long sy, long sw, long sh);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(HTMLCanvasElement canvas, ImageBitmapCa
llback callback);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(HTMLCanvasElement canvas, ImageBitmapCa
llback callback, long sx, long sy, long sw, long sh);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(ImageData data, ImageBitmapCallback cal
lback);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(ImageData data, ImageBitmapCallback cal
lback, long sx, long sy, long sw, long sh);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(ImageBitmap bitmap, ImageBitmapCallback
 callback);
    [EnabledAtRuntime=experimentalCanvasFeatures, RaisesException] void createImageBitmap(ImageBitmap bitmap, ImageBitmapCallback
 callback, long sx, long sy, long sw, long sh);

@efortuna
Copy link
Contributor

Added this to the Later milestone.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@alan-knight
Copy link
Contributor

Removed Priority-Unassigned label.
Added Priority-Medium label.
Changed the title to: "[missing] Expose Window.createImageBitmap".

@vsmenon vsmenon added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html labels Jan 23, 2015
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Feb 29, 2016
@patkujawa-wf
Copy link

I'm not sure what this issue is hoping to achieve, but if it adds support for self.createImageBitmap() - Web APIs | MDN, 👍

@lexaknyazev
Copy link
Contributor

This API is still not exposed as of current dev. Is it because it's unsupported in Edge?

@mnordine
Copy link
Contributor

What's going on with this? I can't find it in dart:html. I see there is ImageBitmap: https://api.dartlang.org/stable/2.1.0/dart-html/ImageBitmap-class.html

But no way to create it? Please, it's been over 5 years now, and this is important functionality. Seems to be a ton of stuff missing from the web platform, :(

@kevmoo
Copy link
Member

kevmoo commented Feb 1, 2019

CC @teresy @vsmenon – we have a big backlog here. We'd like to do work to cleanup our JS-interop work then we plan to come back to all of the web APIs.

Thanks for your patience.

@mnordine
Copy link
Contributor

mnordine commented Feb 1, 2019

Will the JS-interop cleanup somehow improve this situation? Or are they orthogonal?

@kevmoo
Copy link
Member

kevmoo commented Feb 1, 2019

Our current setup for generating Dart APIs over the browser's JS APIs has a number of issues – and it's different than how we let external folks do interop.

We'd like to create a single, better model for both before we spend more time doing one-off fixes to the existing dart:web libraries.

@mnordine
Copy link
Contributor

mnordine commented Feb 1, 2019

Can you point me toward more info on the planned model?

@kevmoo
Copy link
Member

kevmoo commented Feb 1, 2019

@jmesserly may have some details to share

@jmesserly
Copy link

#35084 is tracking JS interop improvements, that would allow an interop-based approach to the DOM.

@mnordine
Copy link
Contributor

mnordine commented Feb 2, 2019

Took a look at https://github.com/dart-lang/sdk/blob/js_interop/pkg/js/proposal.md, and, I gotta say, that looks like it's going to take quite a while to implement. (But it looks great!)

Can there not be a parallel effort here? I understand there's limited resources, but is it really that hard to expose missing APIs? Like this one that was just added? c5cfdc5#diff-2326766614acd647cd69f60e35033cc2

@mnordine
Copy link
Contributor

mnordine commented Feb 2, 2019

Is it something I can maybe pitch in with?

@vsmenon vsmenon added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Jul 20, 2019
@mnordine
Copy link
Contributor

mnordine commented Jan 8, 2020

Any update on this? Seems to still be missing.

@mnordine
Copy link
Contributor

mnordine commented Jan 8, 2020

The kicker here is, I can work around it with package:js's callMethod and promiseToFuture to get an ImageBitmap. But I can't set it as a CanvasImageSource, because ImageBitmap isn't an implementer, even though it certainly should be:

https://api.dart.dev/stable/2.7.0/dart-html/CanvasImageSource-class.html

Right now, I get Expected a value of type 'CanvasImageSource', but got one of type 'ImageBitmap'

Any workarounds?

mnordine referenced this issue Nov 13, 2020
Creates a markdown file that documents issues to help users work
around limitations in dart:html and similar libraries.

Change-Id: I0f83661919f3d09bb2743a84cdcd141a9aa9a87e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171629
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
@srujzs srujzs added the web-libraries Issues impacting dart:html, etc., libraries label Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. library-html P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

10 participants