LibWeb: Provide an IDL definition for CanvasImageSource

This commit is contained in:
Lucas CHOLLET 2024-04-05 09:11:31 -04:00 committed by Andreas Kling
parent 7d5b9122ec
commit af3a73c0a4
Notes: sideshowbarker 2024-07-16 23:05:02 +09:00

View file

@ -1,10 +1,18 @@
#import <HTML/HTMLCanvasElement.idl>
#import <HTML/HTMLImageElement.idl>
typedef (HTMLImageElement or
// FIXME: We should use HTMLOrSVGImageElement instead of HTMLImageElement
// FIXME: HTMLVideoElement or
HTMLCanvasElement
// FIXME: ImageBitmap
// FIXME: OffscreenCanvas
// FIXME: VideoFrame
) CanvasImageSource;
// https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawimage
interface mixin CanvasDrawImage {
// FIXME: These `image` params should be CanvasImageSource
undefined drawImage((HTMLImageElement or HTMLCanvasElement) image, unrestricted double dx, unrestricted double dy);
undefined drawImage((HTMLImageElement or HTMLCanvasElement) image, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
undefined drawImage((HTMLImageElement or HTMLCanvasElement) image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
undefined drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy);
undefined drawImage(CanvasImageSource image, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
undefined drawImage(CanvasImageSource image, unrestricted double sx, unrestricted double sy, unrestricted double sw, unrestricted double sh, unrestricted double dx, unrestricted double dy, unrestricted double dw, unrestricted double dh);
};