Skip to content

Commit

Permalink
Bug 1709959 - Part 2: Remove nsIImageLoadingContent.forceImageState; …
Browse files Browse the repository at this point in the history
…r=emilio

Depends on D114575

Differential Revision: https://phabricator.services.mozilla.com/D114576
  • Loading branch information
EdgarChen committed May 7, 2021
1 parent 1588933 commit d7b0e6c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
7 changes: 0 additions & 7 deletions dom/base/nsIImageLoadingContent.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions dom/base/nsImageLoadingContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions layout/generic/nsVideoFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<nsIImageLoadingContent> imgContent =
do_QueryInterface(mPosterImage);
HTMLImageElement* imgContent = HTMLImageElement::FromNode(mPosterImage);
NS_ENSURE_TRUE(imgContent, NS_ERROR_FAILURE);

imgContent->ForceImageState(true, 0);
Expand Down

0 comments on commit d7b0e6c

Please sign in to comment.