diff --git a/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.cpp b/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.cpp
index bae7b49c5ce..d2d2a42a8ab 100644
--- a/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.cpp
+++ b/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.cpp
@@ -42,6 +42,12 @@ static void default_source_size(CanvasImageSource const& image, float& source_wi
source_height = source->video_height();
}
},
+ [&source_width, &source_height](GC::Root const& source) {
+ auto const bitmap = source->bitmap();
+
+ source_width = bitmap->width();
+ source_height = bitmap->height();
+ },
[&source_width, &source_height](GC::Root const& source) {
if (source->surface()) {
source_width = source->surface()->size().width();
diff --git a/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.h b/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.h
index 3c20a55f2fc..9077a824e62 100644
--- a/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.h
+++ b/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.h
@@ -10,13 +10,14 @@
#include
#include
#include
+#include
#include
namespace Web::HTML {
// https://html.spec.whatwg.org/multipage/canvas.html#canvasimagesource
// NOTE: This is the Variant created by the IDL wrapper generator, and needs to be updated accordingly.
-using CanvasImageSource = Variant, GC::Root, GC::Root, GC::Root, GC::Root>;
+using CanvasImageSource = Variant, GC::Root, GC::Root, GC::Root, GC::Root, GC::Root>;
// https://html.spec.whatwg.org/multipage/canvas.html#canvasdrawimage
class CanvasDrawImage {
diff --git a/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.idl b/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.idl
index df5c3ac36fe..a475376fe33 100644
--- a/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.idl
+++ b/Libraries/LibWeb/HTML/Canvas/CanvasDrawImage.idl
@@ -1,6 +1,7 @@
#import
#import
#import
+#import
#import
#import