fix for bug #52663
-r hyatt -a waterson git-svn-id: svn://10.0.0.236/trunk@79683 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -683,7 +683,8 @@ DocumentViewerImpl::Stop(void)
|
||||
}
|
||||
|
||||
if (mPresContext) {
|
||||
mPresContext->Stop();
|
||||
// stop everything but the chrome.
|
||||
mPresContext->Stop(PR_FALSE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -683,7 +683,8 @@ DocumentViewerImpl::Stop(void)
|
||||
}
|
||||
|
||||
if (mPresContext) {
|
||||
mPresContext->Stop();
|
||||
// stop everything but the chrome.
|
||||
mPresContext->Stop(PR_FALSE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -96,6 +96,9 @@ nsPresContext::nsPresContext()
|
||||
mCompatibilityLocked = PR_FALSE;
|
||||
mWidgetRenderingMode = eWidgetRendering_Gfx;
|
||||
mImageAnimationMode = eImageAnimation_Normal;
|
||||
|
||||
mStopped = PR_FALSE;
|
||||
mStopChrome = PR_TRUE;
|
||||
|
||||
mShell = nsnull;
|
||||
|
||||
@@ -913,10 +916,15 @@ nsPresContext::StartLoadImage(const nsString& aURL,
|
||||
nsIFrameImageLoader** aResult)
|
||||
{
|
||||
if (mStopped) {
|
||||
if (aResult) {
|
||||
*aResult = nsnull;
|
||||
}
|
||||
return NS_OK;
|
||||
// if we are stopped and the image is not chrome
|
||||
// don't load.
|
||||
// If we are chrome don't load if we
|
||||
// were told to stop chrome
|
||||
if (!aURL.EqualsWithConversion("chrome:", PR_TRUE, 7) || mStopChrome) {
|
||||
if (aResult) {
|
||||
*aResult = nsnull;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Allow for a null target frame argument (for precached images)
|
||||
@@ -1011,13 +1019,14 @@ nsPresContext::StartLoadImage(const nsString& aURL,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::Stop(void)
|
||||
nsPresContext::Stop(PRBool aStopChrome)
|
||||
{
|
||||
mStopChrome = aStopChrome;
|
||||
PRInt32 n = mImageLoaders.Count();
|
||||
for (PRInt32 i = 0; i < n; i++) {
|
||||
nsIFrameImageLoader* loader;
|
||||
loader = (nsIFrameImageLoader*) mImageLoaders.ElementAt(i);
|
||||
loader->StopImageLoad();
|
||||
loader->StopImageLoad(aStopChrome);
|
||||
NS_RELEASE(loader);
|
||||
}
|
||||
mImageLoaders.Clear();
|
||||
|
||||
@@ -103,8 +103,9 @@ public:
|
||||
|
||||
/**
|
||||
* Stop the presentation in preperation for destruction.
|
||||
* @param aStopChrome PR_TRUE to stop chrome as well.
|
||||
*/
|
||||
NS_IMETHOD Stop(void) = 0;
|
||||
NS_IMETHOD Stop(PRBool aStopChrome = PR_TRUE) = 0;
|
||||
|
||||
/**
|
||||
* Set the presentation shell that this context is bound to.
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
nsIFrameImageLoaderCB aCallBack,
|
||||
void* aClosure, void* aKey) = 0;
|
||||
|
||||
NS_IMETHOD StopImageLoad() = 0;
|
||||
NS_IMETHOD StopImageLoad(PRBool aStopChrome = PR_TRUE) = 0;
|
||||
|
||||
NS_IMETHOD AbortImageLoad() = 0;
|
||||
|
||||
|
||||
@@ -103,8 +103,9 @@ public:
|
||||
|
||||
/**
|
||||
* Stop the presentation in preperation for destruction.
|
||||
* @param aStopChrome PR_TRUE to stop chrome as well.
|
||||
*/
|
||||
NS_IMETHOD Stop(void) = 0;
|
||||
NS_IMETHOD Stop(PRBool aStopChrome = PR_TRUE) = 0;
|
||||
|
||||
/**
|
||||
* Set the presentation shell that this context is bound to.
|
||||
|
||||
@@ -103,8 +103,9 @@ public:
|
||||
|
||||
/**
|
||||
* Stop the presentation in preperation for destruction.
|
||||
* @param aStopChrome PR_TRUE to stop chrome as well.
|
||||
*/
|
||||
NS_IMETHOD Stop(void) = 0;
|
||||
NS_IMETHOD Stop(PRBool aStopChrome = PR_TRUE) = 0;
|
||||
|
||||
/**
|
||||
* Set the presentation shell that this context is bound to.
|
||||
|
||||
@@ -683,7 +683,8 @@ DocumentViewerImpl::Stop(void)
|
||||
}
|
||||
|
||||
if (mPresContext) {
|
||||
mPresContext->Stop();
|
||||
// stop everything but the chrome.
|
||||
mPresContext->Stop(PR_FALSE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "nsIStyleContext.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIDeviceContext.h"
|
||||
#include "nsXPIDLString.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#undef NOISY_IMAGE_LOADING
|
||||
@@ -251,8 +252,14 @@ nsFrameImageLoader::RemoveFrame(void* aKey)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameImageLoader::StopImageLoad()
|
||||
nsFrameImageLoader::StopImageLoad(PRBool aStopChrome)
|
||||
{
|
||||
// don't stop chrome
|
||||
if (!aStopChrome) {
|
||||
if (mURL.EqualsWithConversion("chrome:", PR_TRUE, 7))
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NOISY_IMAGE_LOADING
|
||||
printf(" %p: stopping ", this);
|
||||
fputs(mURL, stdout);
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
nsIFrameImageLoaderCB aCallBack,
|
||||
void* aClosure, void* aKey);
|
||||
|
||||
NS_IMETHOD StopImageLoad();
|
||||
NS_IMETHOD StopImageLoad(PRBool aStopChrome = PR_TRUE);
|
||||
|
||||
NS_IMETHOD AbortImageLoad();
|
||||
|
||||
|
||||
@@ -96,6 +96,9 @@ nsPresContext::nsPresContext()
|
||||
mCompatibilityLocked = PR_FALSE;
|
||||
mWidgetRenderingMode = eWidgetRendering_Gfx;
|
||||
mImageAnimationMode = eImageAnimation_Normal;
|
||||
|
||||
mStopped = PR_FALSE;
|
||||
mStopChrome = PR_TRUE;
|
||||
|
||||
mShell = nsnull;
|
||||
|
||||
@@ -913,10 +916,15 @@ nsPresContext::StartLoadImage(const nsString& aURL,
|
||||
nsIFrameImageLoader** aResult)
|
||||
{
|
||||
if (mStopped) {
|
||||
if (aResult) {
|
||||
*aResult = nsnull;
|
||||
}
|
||||
return NS_OK;
|
||||
// if we are stopped and the image is not chrome
|
||||
// don't load.
|
||||
// If we are chrome don't load if we
|
||||
// were told to stop chrome
|
||||
if (!aURL.EqualsWithConversion("chrome:", PR_TRUE, 7) || mStopChrome) {
|
||||
if (aResult) {
|
||||
*aResult = nsnull;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Allow for a null target frame argument (for precached images)
|
||||
@@ -1011,13 +1019,14 @@ nsPresContext::StartLoadImage(const nsString& aURL,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::Stop(void)
|
||||
nsPresContext::Stop(PRBool aStopChrome)
|
||||
{
|
||||
mStopChrome = aStopChrome;
|
||||
PRInt32 n = mImageLoaders.Count();
|
||||
for (PRInt32 i = 0; i < n; i++) {
|
||||
nsIFrameImageLoader* loader;
|
||||
loader = (nsIFrameImageLoader*) mImageLoaders.ElementAt(i);
|
||||
loader->StopImageLoad();
|
||||
loader->StopImageLoad(aStopChrome);
|
||||
NS_RELEASE(loader);
|
||||
}
|
||||
mImageLoaders.Clear();
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
// nsIPresContext methods
|
||||
NS_IMETHOD Init(nsIDeviceContext* aDeviceContext);
|
||||
NS_IMETHOD Stop(void);
|
||||
NS_IMETHOD Stop(PRBool aStopChrome = PR_TRUE);
|
||||
NS_IMETHOD SetShell(nsIPresShell* aShell);
|
||||
NS_IMETHOD GetShell(nsIPresShell** aResult);
|
||||
NS_IMETHOD GetCompatibilityMode(nsCompatibility* aModeResult);
|
||||
@@ -192,6 +192,7 @@ protected:
|
||||
nsImageAnimation mImageAnimationMode;
|
||||
PRPackedBool mImageAnimationStopped; // image animation stopped
|
||||
PRPackedBool mStopped; // loading stopped
|
||||
PRPackedBool mStopChrome; // should we stop chrome?
|
||||
PRUint8 mDefaultDirection;
|
||||
|
||||
#ifdef DEBUG
|
||||
|
||||
Reference in New Issue
Block a user