diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp index 92502b3b9f..6e85e0e167 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -234,9 +234,11 @@ bool HTMLImageElement::complete() const return true; // - The img element's current request's state is completely available and its pending request is null. + if (m_current_request->state() == ImageRequest::State::CompletelyAvailable && !m_pending_request) + return true; + // - The img element's current request's state is broken and its pending request is null. - // FIXME: This is ad-hoc and should be updated once we are loading images via the Fetch mechanism. - if (auto bitmap = current_image_bitmap()) + if (m_current_request->state() == ImageRequest::State::Broken && !m_pending_request) return true; return false;