mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement HTMLCanvasElement.toBlob (#34938)
This refactors some of the code that is shared with toDataURL, and updates the webidl definition to match the current spec (using a default value for the mime type). Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
9aaa6934b7
commit
44d1e2ae0d
13 changed files with 206 additions and 130 deletions
|
@ -18,8 +18,10 @@ interface HTMLCanvasElement : HTMLElement {
|
|||
RenderingContext? getContext(DOMString contextId, optional any options = null);
|
||||
|
||||
[Throws]
|
||||
USVString toDataURL(optional DOMString type, optional any quality);
|
||||
//void toBlob(BlobCallback _callback, optional DOMString type, optional any quality);
|
||||
USVString toDataURL(optional DOMString type = "image/png", optional any quality);
|
||||
|
||||
[Throws]
|
||||
undefined toBlob(BlobCallback callback, optional DOMString type = "image/png", optional any quality);
|
||||
//OffscreenCanvas transferControlToOffscreen();
|
||||
};
|
||||
|
||||
|
@ -28,4 +30,4 @@ partial interface HTMLCanvasElement {
|
|||
MediaStream captureStream (optional double frameRequestRate);
|
||||
};
|
||||
|
||||
//callback BlobCallback = void (Blob? blob);
|
||||
callback BlobCallback = undefined(Blob? blob);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue