diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
index 34a91259c4..62651ec82c 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp
@@ -125,6 +125,13 @@ RefPtr HTMLImageElement::immutable_bitmap() const
return current_image_bitmap();
}
+RefPtr HTMLImageElement::bitmap() const
+{
+ if (auto immutable_bitmap = this->immutable_bitmap())
+ return immutable_bitmap->bitmap();
+ return {};
+}
+
Optional HTMLImageElement::intrinsic_width() const
{
if (auto image_data = m_current_request->image_data())
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h
index 771c8cfd54..dea9147172 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h
+++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h
@@ -40,7 +40,7 @@ public:
DeprecatedString src() const { return deprecated_attribute(HTML::AttributeNames::src); }
RefPtr immutable_bitmap() const;
- RefPtr bitmap() const { return immutable_bitmap()->bitmap(); }
+ RefPtr bitmap() const;
unsigned width() const;
WebIDL::ExceptionOr set_width(unsigned);