From af3a73c0a4216399204500b2b88de29df4e3faab Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Fri, 5 Apr 2024 09:11:31 -0400 Subject: [PATCH] LibWeb: Provide an IDL definition for CanvasImageSource --- .../LibWeb/HTML/Canvas/CanvasDrawImage.idl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.idl b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.idl index 35dd06c2f47..f944f045fe2 100644 --- a/Userland/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.idl +++ b/Userland/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.idl @@ -1,10 +1,18 @@ #import #import +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); };