From d7b0e6c762e75a085ee0edf0838566d70a83bba5 Mon Sep 17 00:00:00 2001 From: Edgar Chen Date: Fri, 7 May 2021 10:36:40 +0000 Subject: [PATCH] Bug 1709959 - Part 2: Remove nsIImageLoadingContent.forceImageState; r=emilio Depends on D114575 Differential Revision: https://phabricator.services.mozilla.com/D114576 --- dom/base/nsIImageLoadingContent.idl | 7 ------- dom/base/nsImageLoadingContent.h | 7 +++++++ layout/generic/nsVideoFrame.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dom/base/nsIImageLoadingContent.idl b/dom/base/nsIImageLoadingContent.idl index 539a6a1352580..8bef1b9908f02 100644 --- a/dom/base/nsIImageLoadingContent.idl +++ b/dom/base/nsIImageLoadingContent.idl @@ -141,13 +141,6 @@ interface nsIImageLoadingContent : imgINotificationObserver */ [noscript] nsIStreamListener loadImageWithChannel(in nsIChannel aChannel); - /** - * Enables/disables image state forcing. When |aForce| is true, we force - * nsImageLoadingContent::ImageState() to return |aState|. Call again with |aForce| - * as false to revert ImageState() to its original behaviour. - */ - [notxpcom, nostdcall] void forceImageState(in boolean aForce, in unsigned long long aState); - /** * Called by layout to announce when the frame associated with this content * has changed its visibility state. diff --git a/dom/base/nsImageLoadingContent.h b/dom/base/nsImageLoadingContent.h index fc78872eb5937..b239ed6b71cad 100644 --- a/dom/base/nsImageLoadingContent.h +++ b/dom/base/nsImageLoadingContent.h @@ -92,6 +92,13 @@ class nsImageLoadingContent : public nsIImageLoadingContent { */ void NotifyOwnerDocumentActivityChanged(); + /** + * Enables/disables image state forcing. When |aForce| is true, we force + * nsImageLoadingContent::ImageState() to return |aState|. Call again with + * |aForce| as false to revert ImageState() to its original behaviour. + */ + void ForceImageState(bool aForce, mozilla::EventStates::InternalType aState); + protected: enum ImageLoadType { // Most normal image loads diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp index 643d6f9b7c2f7..5e7ec57516592 100644 --- a/layout/generic/nsVideoFrame.cpp +++ b/layout/generic/nsVideoFrame.cpp @@ -12,6 +12,7 @@ #include "nsGkAtoms.h" #include "mozilla/PresShell.h" +#include "mozilla/dom/HTMLImageElement.h" #include "mozilla/dom/HTMLVideoElement.h" #include "mozilla/dom/ShadowRoot.h" #include "mozilla/layers/RenderRootStateManager.h" @@ -104,8 +105,7 @@ nsresult nsVideoFrame::CreateAnonymousContent( // image will always report its state as 0, so it will never be reframed // to show frames for loading or the broken image icon. This is important, // as the image is native anonymous, and so can't be reframed (currently). - nsCOMPtr imgContent = - do_QueryInterface(mPosterImage); + HTMLImageElement* imgContent = HTMLImageElement::FromNode(mPosterImage); NS_ENSURE_TRUE(imgContent, NS_ERROR_FAILURE); imgContent->ForceImageState(true, 0);