WIP for bug 33810 -- add an image animation enum, and getters and setters in the pres context
git-svn-id: svn://10.0.0.236/trunk@69516 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -93,7 +93,8 @@ nsPresContext::nsPresContext()
|
||||
mCompatibilityMode = eCompatibility_Standard;
|
||||
mCompatibilityLocked = PR_FALSE;
|
||||
mWidgetRenderingMode = eWidgetRendering_Gfx;
|
||||
|
||||
mImageAnimationMode = eImageAnimation_Normal;
|
||||
|
||||
mLookAndFeel = nsnull;
|
||||
mShell = nsnull;
|
||||
|
||||
@@ -403,10 +404,7 @@ nsPresContext::SetCompatibilityMode(nsCompatibility aMode)
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::GetWidgetRenderingMode(nsWidgetRendering* aResult)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aResult, "null ptr");
|
||||
if (nsnull == aResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = mWidgetRenderingMode;
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -419,6 +417,22 @@ nsPresContext::SetWidgetRenderingMode(nsWidgetRendering aMode)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::GetImageAnimationMode(nsImageAnimation* aModeResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aModeResult);
|
||||
*aModeResult = mImageAnimationMode;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::SetImageAnimationMode(nsImageAnimation aMode)
|
||||
{
|
||||
mImageAnimationMode = aMode;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPresContext::GetLookAndFeel(nsILookAndFeel** aLookAndFeel)
|
||||
@@ -862,7 +876,7 @@ nsPresContext::StartLoadImage(const nsString& aURL,
|
||||
}
|
||||
|
||||
// Allow for a null target frame argument (for precached images)
|
||||
if (nsnull != aTargetFrame) {
|
||||
if (aTargetFrame) {
|
||||
// Mark frame as having loaded an image
|
||||
nsFrameState state;
|
||||
aTargetFrame->GetFrameState(&state);
|
||||
@@ -920,7 +934,7 @@ nsPresContext::StartLoadImage(const nsString& aURL,
|
||||
}
|
||||
|
||||
rv = loader->Init(this, mImageGroup, aURL, aBackgroundColor, aDesiredSize,
|
||||
aTargetFrame, aCallBack, aClosure);
|
||||
aTargetFrame, mImageAnimationMode, aCallBack, aClosure);
|
||||
if (NS_OK != rv) {
|
||||
mImageLoaders.RemoveElement(loader);
|
||||
loader->StopImageLoad();
|
||||
|
||||
Reference in New Issue
Block a user