mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 7f708623bf59 (from bug 322475, which made us construct all our image loaders at frame construction time) because of issues with propagation of backgrounds to the canvas (bug 460796).
--HG-- rename : layout/base/nsImageLoadNotifier.cpp => layout/base/nsImageLoader.cpp rename : layout/base/nsImageLoadNotifier.h => layout/base/nsImageLoader.h
This commit is contained in:
parent
2bd8ac7a44
commit
e7cd23e3ac
@ -129,7 +129,7 @@ CPPSRCS = \
|
|||||||
nsFrameManager.cpp \
|
nsFrameManager.cpp \
|
||||||
nsFrameTraversal.cpp \
|
nsFrameTraversal.cpp \
|
||||||
nsGenConList.cpp \
|
nsGenConList.cpp \
|
||||||
nsImageLoadNotifier.cpp \
|
nsImageLoader.cpp \
|
||||||
nsLayoutDebugger.cpp \
|
nsLayoutDebugger.cpp \
|
||||||
nsLayoutHistoryState.cpp \
|
nsLayoutHistoryState.cpp \
|
||||||
nsLayoutUtils.cpp \
|
nsLayoutUtils.cpp \
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
/* class to notify frames of background image loads */
|
/* class to notify frames of background image loads */
|
||||||
|
|
||||||
#include "nsImageLoadNotifier.h"
|
#include "nsImageLoader.h"
|
||||||
|
|
||||||
#include "imgILoader.h"
|
#include "imgILoader.h"
|
||||||
|
|
||||||
@ -61,18 +61,17 @@
|
|||||||
// Paint forcing
|
// Paint forcing
|
||||||
#include "prenv.h"
|
#include "prenv.h"
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS2(nsImageLoadNotifier, imgIDecoderObserver, imgIContainerObserver)
|
NS_IMPL_ISUPPORTS2(nsImageLoader, imgIDecoderObserver, imgIContainerObserver)
|
||||||
|
|
||||||
nsImageLoadNotifier::nsImageLoadNotifier(nsIFrame *aFrame,
|
nsImageLoader::nsImageLoader(nsIFrame *aFrame, PRBool aReflowOnLoad,
|
||||||
PRBool aReflowOnLoad,
|
nsImageLoader *aNextLoader)
|
||||||
nsImageLoadNotifier *aNextLoader)
|
|
||||||
: mFrame(aFrame),
|
: mFrame(aFrame),
|
||||||
mReflowOnLoad(aReflowOnLoad),
|
mReflowOnLoad(aReflowOnLoad),
|
||||||
mNextLoader(aNextLoader)
|
mNextLoader(aNextLoader)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
nsImageLoadNotifier::~nsImageLoadNotifier()
|
nsImageLoader::~nsImageLoader()
|
||||||
{
|
{
|
||||||
mFrame = nsnull;
|
mFrame = nsnull;
|
||||||
|
|
||||||
@ -81,13 +80,12 @@ nsImageLoadNotifier::~nsImageLoadNotifier()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ already_AddRefed<nsImageLoadNotifier>
|
/* static */ already_AddRefed<nsImageLoader>
|
||||||
nsImageLoadNotifier::Create(nsIFrame *aFrame, imgIRequest *aRequest,
|
nsImageLoader::Create(nsIFrame *aFrame, imgIRequest *aRequest,
|
||||||
PRBool aReflowOnLoad,
|
PRBool aReflowOnLoad, nsImageLoader *aNextLoader)
|
||||||
nsImageLoadNotifier *aNextLoader)
|
|
||||||
{
|
{
|
||||||
nsRefPtr<nsImageLoadNotifier> loader =
|
nsRefPtr<nsImageLoader> loader =
|
||||||
new nsImageLoadNotifier(aFrame, aReflowOnLoad, aNextLoader);
|
new nsImageLoader(aFrame, aReflowOnLoad, aNextLoader);
|
||||||
|
|
||||||
loader->Load(aRequest);
|
loader->Load(aRequest);
|
||||||
|
|
||||||
@ -95,13 +93,13 @@ nsImageLoadNotifier::Create(nsIFrame *aFrame, imgIRequest *aRequest,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsImageLoadNotifier::Destroy()
|
nsImageLoader::Destroy()
|
||||||
{
|
{
|
||||||
// Destroy the chain with only one level of recursion.
|
// Destroy the chain with only one level of recursion.
|
||||||
nsRefPtr<nsImageLoadNotifier> list = mNextLoader;
|
nsRefPtr<nsImageLoader> list = mNextLoader;
|
||||||
mNextLoader = nsnull;
|
mNextLoader = nsnull;
|
||||||
while (list) {
|
while (list) {
|
||||||
nsRefPtr<nsImageLoadNotifier> todestroy = list;
|
nsRefPtr<nsImageLoader> todestroy = list;
|
||||||
list = todestroy->mNextLoader;
|
list = todestroy->mNextLoader;
|
||||||
todestroy->mNextLoader = nsnull;
|
todestroy->mNextLoader = nsnull;
|
||||||
todestroy->Destroy();
|
todestroy->Destroy();
|
||||||
@ -117,7 +115,7 @@ nsImageLoadNotifier::Destroy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsImageLoadNotifier::Load(imgIRequest *aImage)
|
nsImageLoader::Load(imgIRequest *aImage)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!mRequest, "can't reuse image loaders");
|
NS_ASSERTION(!mRequest, "can't reuse image loaders");
|
||||||
|
|
||||||
@ -138,8 +136,8 @@ nsImageLoadNotifier::Load(imgIRequest *aImage)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP nsImageLoadNotifier::OnStartContainer(imgIRequest *aRequest,
|
NS_IMETHODIMP nsImageLoader::OnStartContainer(imgIRequest *aRequest,
|
||||||
imgIContainer *aImage)
|
imgIContainer *aImage)
|
||||||
{
|
{
|
||||||
if (aImage)
|
if (aImage)
|
||||||
{
|
{
|
||||||
@ -155,8 +153,8 @@ NS_IMETHODIMP nsImageLoadNotifier::OnStartContainer(imgIRequest *aRequest,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsImageLoadNotifier::OnStopFrame(imgIRequest *aRequest,
|
NS_IMETHODIMP nsImageLoader::OnStopFrame(imgIRequest *aRequest,
|
||||||
gfxIImageFrame *aFrame)
|
gfxIImageFrame *aFrame)
|
||||||
{
|
{
|
||||||
if (!mFrame)
|
if (!mFrame)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
@ -183,9 +181,9 @@ NS_IMETHODIMP nsImageLoadNotifier::OnStopFrame(imgIRequest *aRequest,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsImageLoadNotifier::FrameChanged(imgIContainer *aContainer,
|
NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer,
|
||||||
gfxIImageFrame *newframe,
|
gfxIImageFrame *newframe,
|
||||||
nsRect * dirtyRect)
|
nsRect * dirtyRect)
|
||||||
{
|
{
|
||||||
if (!mFrame)
|
if (!mFrame)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
@ -209,7 +207,7 @@ NS_IMETHODIMP nsImageLoadNotifier::FrameChanged(imgIContainer *aContainer,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nsImageLoadNotifier::RedrawDirtyFrame(const nsRect* aDamageRect)
|
nsImageLoader::RedrawDirtyFrame(const nsRect* aDamageRect)
|
||||||
{
|
{
|
||||||
if (mReflowOnLoad) {
|
if (mReflowOnLoad) {
|
||||||
nsIPresShell *shell = mFrame->PresContext()->GetPresShell();
|
nsIPresShell *shell = mFrame->PresContext()->GetPresShell();
|
@ -54,17 +54,17 @@ class nsIURI;
|
|||||||
*
|
*
|
||||||
* Each frame's image loaders form a linked list.
|
* Each frame's image loaders form a linked list.
|
||||||
*/
|
*/
|
||||||
class nsImageLoadNotifier : public nsStubImageDecoderObserver
|
class nsImageLoader : public nsStubImageDecoderObserver
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
nsImageLoadNotifier(nsIFrame *aFrame, PRBool aReflowOnLoad,
|
nsImageLoader(nsIFrame *aFrame, PRBool aReflowOnLoad,
|
||||||
nsImageLoadNotifier *aNextLoader);
|
nsImageLoader *aNextLoader);
|
||||||
virtual ~nsImageLoadNotifier();
|
virtual ~nsImageLoader();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static already_AddRefed<nsImageLoadNotifier>
|
static already_AddRefed<nsImageLoader>
|
||||||
Create(nsIFrame *aFrame, imgIRequest *aRequest,
|
Create(nsIFrame *aFrame, imgIRequest *aRequest,
|
||||||
PRBool aReflowOnLoad, nsImageLoadNotifier *aNextLoader);
|
PRBool aReflowOnLoad, nsImageLoader *aNextLoader);
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ public:
|
|||||||
void Destroy();
|
void Destroy();
|
||||||
|
|
||||||
imgIRequest *GetRequest() { return mRequest; }
|
imgIRequest *GetRequest() { return mRequest; }
|
||||||
nsImageLoadNotifier *GetNextLoader() { return mNextLoader; }
|
nsImageLoader *GetNextLoader() { return mNextLoader; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsresult Load(imgIRequest *aImage);
|
nsresult Load(imgIRequest *aImage);
|
||||||
@ -94,5 +94,5 @@ private:
|
|||||||
nsIFrame *mFrame;
|
nsIFrame *mFrame;
|
||||||
nsCOMPtr<imgIRequest> mRequest;
|
nsCOMPtr<imgIRequest> mRequest;
|
||||||
PRBool mReflowOnLoad;
|
PRBool mReflowOnLoad;
|
||||||
nsRefPtr<nsImageLoadNotifier> mNextLoader;
|
nsRefPtr<nsImageLoader> mNextLoader;
|
||||||
};
|
};
|
@ -49,7 +49,7 @@
|
|||||||
#include "nsPIDOMWindow.h"
|
#include "nsPIDOMWindow.h"
|
||||||
#include "nsIFocusController.h"
|
#include "nsIFocusController.h"
|
||||||
#include "nsStyleSet.h"
|
#include "nsStyleSet.h"
|
||||||
#include "nsImageLoadNotifier.h"
|
#include "nsImageLoader.h"
|
||||||
#include "nsIContent.h"
|
#include "nsIContent.h"
|
||||||
#include "nsIFrame.h"
|
#include "nsIFrame.h"
|
||||||
#include "nsIRenderingContext.h"
|
#include "nsIRenderingContext.h"
|
||||||
@ -150,7 +150,7 @@ IsVisualCharset(const nsCString& aCharset)
|
|||||||
|
|
||||||
|
|
||||||
static PLDHashOperator
|
static PLDHashOperator
|
||||||
destroy_notifiers(const void * aKey, nsRefPtr<nsImageLoadNotifier>& aData, void* closure)
|
destroy_loads(const void * aKey, nsRefPtr<nsImageLoader>& aData, void* closure)
|
||||||
{
|
{
|
||||||
aData->Destroy();
|
aData->Destroy();
|
||||||
return PL_DHASH_NEXT;
|
return PL_DHASH_NEXT;
|
||||||
@ -231,7 +231,7 @@ nsPresContext::nsPresContext(nsIDocument* aDocument, nsPresContextType aType)
|
|||||||
|
|
||||||
nsPresContext::~nsPresContext()
|
nsPresContext::~nsPresContext()
|
||||||
{
|
{
|
||||||
mImageNotifiers.Enumerate(destroy_notifiers, nsnull);
|
mImageLoaders.Enumerate(destroy_loads, nsnull);
|
||||||
|
|
||||||
NS_PRECONDITION(!mShell, "Presshell forgot to clear our mShell pointer");
|
NS_PRECONDITION(!mShell, "Presshell forgot to clear our mShell pointer");
|
||||||
SetShell(nsnull);
|
SetShell(nsnull);
|
||||||
@ -299,7 +299,7 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPresContext)
|
|||||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPresContext)
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPresContext)
|
||||||
|
|
||||||
static PLDHashOperator
|
static PLDHashOperator
|
||||||
TraverseImageNotifier(const void * aKey, nsRefPtr<nsImageLoadNotifier>& aData,
|
TraverseImageLoader(const void * aKey, nsRefPtr<nsImageLoader>& aData,
|
||||||
void* aClosure)
|
void* aClosure)
|
||||||
{
|
{
|
||||||
nsCycleCollectionTraversalCallback *cb =
|
nsCycleCollectionTraversalCallback *cb =
|
||||||
@ -317,7 +317,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsPresContext)
|
|||||||
// NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mLookAndFeel); // a service
|
// NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mLookAndFeel); // a service
|
||||||
// NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mLangGroup); // an atom
|
// NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mLangGroup); // an atom
|
||||||
|
|
||||||
tmp->mImageNotifiers.Enumerate(TraverseImageNotifier, &cb);
|
tmp->mImageLoaders.Enumerate(TraverseImageLoader, &cb);
|
||||||
|
|
||||||
// NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTheme); // a service
|
// NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mTheme); // a service
|
||||||
// NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mLangService); // a service
|
// NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mLangService); // a service
|
||||||
@ -339,8 +339,8 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsPresContext)
|
|||||||
// NS_RELEASE(tmp->mLookAndFeel); // a service
|
// NS_RELEASE(tmp->mLookAndFeel); // a service
|
||||||
// NS_RELEASE(tmp->mLangGroup); // an atom
|
// NS_RELEASE(tmp->mLangGroup); // an atom
|
||||||
|
|
||||||
tmp->mImageNotifiers.Enumerate(destroy_notifiers, nsnull);
|
tmp->mImageLoaders.Enumerate(destroy_loads, nsnull);
|
||||||
tmp->mImageNotifiers.Clear();
|
tmp->mImageLoaders.Clear();
|
||||||
|
|
||||||
// NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTheme); // a service
|
// NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mTheme); // a service
|
||||||
// NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mLangService); // a service
|
// NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mLangService); // a service
|
||||||
@ -813,7 +813,7 @@ nsPresContext::Init(nsIDeviceContext* aDeviceContext)
|
|||||||
mDeviceContext->FlushFontCache();
|
mDeviceContext->FlushFontCache();
|
||||||
mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
|
mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
|
||||||
|
|
||||||
if (!mImageNotifiers.Init())
|
if (!mImageLoaders.Init())
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
// Get the look and feel service here; default colors will be initialized
|
// Get the look and feel service here; default colors will be initialized
|
||||||
@ -1025,9 +1025,9 @@ static void SetImgAnimModeOnImgReq(imgIRequest* aImgReq, PRUint16 aMode)
|
|||||||
|
|
||||||
// Enumeration call back for HashTable
|
// Enumeration call back for HashTable
|
||||||
static PLDHashOperator
|
static PLDHashOperator
|
||||||
set_animation_mode(const void * aKey, nsRefPtr<nsImageLoadNotifier>& aData, void* closure)
|
set_animation_mode(const void * aKey, nsRefPtr<nsImageLoader>& aData, void* closure)
|
||||||
{
|
{
|
||||||
for (nsImageLoadNotifier *loader = aData; loader;
|
for (nsImageLoader *loader = aData; loader;
|
||||||
loader = loader->GetNextLoader()) {
|
loader = loader->GetNextLoader()) {
|
||||||
imgIRequest* imgReq = loader->GetRequest();
|
imgIRequest* imgReq = loader->GetRequest();
|
||||||
SetImgAnimModeOnImgReq(imgReq, (PRUint16)NS_PTR_TO_INT32(closure));
|
SetImgAnimModeOnImgReq(imgReq, (PRUint16)NS_PTR_TO_INT32(closure));
|
||||||
@ -1069,7 +1069,7 @@ nsPresContext::SetImageAnimationModeInternal(PRUint16 aMode)
|
|||||||
|
|
||||||
// This hash table contains a list of background images
|
// This hash table contains a list of background images
|
||||||
// so iterate over it and set the mode
|
// so iterate over it and set the mode
|
||||||
mImageNotifiers.Enumerate(set_animation_mode, NS_INT32_TO_PTR(aMode));
|
mImageLoaders.Enumerate(set_animation_mode, NS_INT32_TO_PTR(aMode));
|
||||||
|
|
||||||
// Now walk the content tree and set the animation mode
|
// Now walk the content tree and set the animation mode
|
||||||
// on all the images
|
// on all the images
|
||||||
@ -1167,26 +1167,26 @@ nsPresContext::SetFullZoom(float aZoom)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsPresContext::SetImageNotifiers(nsIFrame* aTargetFrame,
|
nsPresContext::SetImageLoaders(nsIFrame* aTargetFrame,
|
||||||
nsImageLoadNotifier* aImageNotifiers)
|
nsImageLoader* aImageLoaders)
|
||||||
{
|
{
|
||||||
nsRefPtr<nsImageLoadNotifier> oldNotifiers;
|
nsRefPtr<nsImageLoader> oldLoaders;
|
||||||
mImageNotifiers.Get(aTargetFrame, getter_AddRefs(oldNotifiers));
|
mImageLoaders.Get(aTargetFrame, getter_AddRefs(oldLoaders));
|
||||||
|
|
||||||
if (aImageNotifiers) {
|
if (aImageLoaders) {
|
||||||
mImageNotifiers.Put(aTargetFrame, aImageNotifiers);
|
mImageLoaders.Put(aTargetFrame, aImageLoaders);
|
||||||
} else if (oldNotifiers) {
|
} else if (oldLoaders) {
|
||||||
mImageNotifiers.Remove(aTargetFrame);
|
mImageLoaders.Remove(aTargetFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldNotifiers)
|
if (oldLoaders)
|
||||||
oldNotifiers->Destroy();
|
oldLoaders->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nsPresContext::StopImagesFor(nsIFrame* aTargetFrame)
|
nsPresContext::StopImagesFor(nsIFrame* aTargetFrame)
|
||||||
{
|
{
|
||||||
SetImageNotifiers(aTargetFrame, nsnull);
|
SetImageLoaders(aTargetFrame, nsnull);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
#include "gfxRect.h"
|
#include "gfxRect.h"
|
||||||
#include "nsRegion.h"
|
#include "nsRegion.h"
|
||||||
|
|
||||||
class nsImageLoadNotifier;
|
class nsImageLoader;
|
||||||
#ifdef IBMBIDI
|
#ifdef IBMBIDI
|
||||||
class nsBidiPresUtils;
|
class nsBidiPresUtils;
|
||||||
#endif // IBMBIDI
|
#endif // IBMBIDI
|
||||||
@ -364,8 +364,8 @@ public:
|
|||||||
* aImage loads, where aImage is its background image. Only a single
|
* aImage loads, where aImage is its background image. Only a single
|
||||||
* image will be tracked per frame.
|
* image will be tracked per frame.
|
||||||
*/
|
*/
|
||||||
NS_HIDDEN_(void) SetImageNotifiers(nsIFrame* aTargetFrame,
|
NS_HIDDEN_(void) SetImageLoaders(nsIFrame* aTargetFrame,
|
||||||
nsImageLoadNotifier* aImageNotifiers);
|
nsImageLoader* aImageLoaders);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when a frame is being destroyed to
|
* This method is called when a frame is being destroyed to
|
||||||
@ -764,7 +764,7 @@ protected:
|
|||||||
nsILinkHandler* mLinkHandler; // [WEAK]
|
nsILinkHandler* mLinkHandler; // [WEAK]
|
||||||
nsIAtom* mLangGroup; // [STRONG]
|
nsIAtom* mLangGroup; // [STRONG]
|
||||||
|
|
||||||
nsRefPtrHashtable<nsVoidPtrHashKey, nsImageLoadNotifier> mImageNotifiers;
|
nsRefPtrHashtable<nsVoidPtrHashKey, nsImageLoader> mImageLoaders;
|
||||||
|
|
||||||
nsWeakPtr mContainer;
|
nsWeakPtr mContainer;
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@
|
|||||||
#include "nsBoxLayoutState.h"
|
#include "nsBoxLayoutState.h"
|
||||||
#include "nsBlockFrame.h"
|
#include "nsBlockFrame.h"
|
||||||
#include "nsDisplayList.h"
|
#include "nsDisplayList.h"
|
||||||
#include "nsImageLoadNotifier.h"
|
#include "nsImageLoader.h"
|
||||||
|
|
||||||
#ifdef MOZ_SVG
|
#ifdef MOZ_SVG
|
||||||
#include "nsSVGIntegrationUtils.h"
|
#include "nsSVGIntegrationUtils.h"
|
||||||
@ -555,24 +555,24 @@ NS_IMETHODIMP nsFrame::DidSetStyleContext()
|
|||||||
{
|
{
|
||||||
// Ensure that this frame gets invalidates (and, in the case of some
|
// Ensure that this frame gets invalidates (and, in the case of some
|
||||||
// 'border-image's, reflows) when images that affect it load.
|
// 'border-image's, reflows) when images that affect it load.
|
||||||
nsRefPtr<nsImageLoadNotifier> notifierChain;
|
nsRefPtr<nsImageLoader> loaderChain;
|
||||||
|
|
||||||
const nsStyleBackground *background = GetStyleBackground();
|
const nsStyleBackground *background = GetStyleBackground();
|
||||||
imgIRequest *newBackgroundImage = background->mBackgroundImage;
|
imgIRequest *newBackgroundImage = background->mBackgroundImage;
|
||||||
if (newBackgroundImage) {
|
if (newBackgroundImage) {
|
||||||
notifierChain = nsImageLoadNotifier::Create(this, newBackgroundImage,
|
loaderChain = nsImageLoader::Create(this, newBackgroundImage,
|
||||||
PR_FALSE, notifierChain);
|
PR_FALSE, loaderChain);
|
||||||
}
|
}
|
||||||
|
|
||||||
const nsStyleBorder *border = GetStyleBorder();
|
const nsStyleBorder *border = GetStyleBorder();
|
||||||
imgIRequest *newBorderImage = border->GetBorderImage();
|
imgIRequest *newBorderImage = border->GetBorderImage();
|
||||||
if (newBorderImage) {
|
if (newBorderImage) {
|
||||||
notifierChain = nsImageLoadNotifier::Create(this, newBorderImage,
|
loaderChain = nsImageLoader::Create(this, newBorderImage,
|
||||||
border->ImageBorderDiffers(),
|
border->ImageBorderDiffers(),
|
||||||
notifierChain);
|
loaderChain);
|
||||||
}
|
}
|
||||||
|
|
||||||
PresContext()->SetImageNotifiers(this, notifierChain);
|
PresContext()->SetImageLoaders(this, loaderChain);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user