diff --git a/layout/base/src/nsFrameImageLoader.cpp b/layout/base/src/nsFrameImageLoader.cpp index 8f1453b94b5e..fe086e42956c 100644 --- a/layout/base/src/nsFrameImageLoader.cpp +++ b/layout/base/src/nsFrameImageLoader.cpp @@ -179,13 +179,17 @@ nsFrameImageLoader::Init(nsIPresContext* aPresContext, // Start image load request char* cp = aURL.ToNewCString(); + + mImageRequest = aGroup->GetImage(cp, this, aBackgroundColor, desiredWidth, desiredHeight, 0); + nsCRT::free(cp); return NS_OK; } + NS_IMETHODIMP nsFrameImageLoader::AddFrame(nsIFrame* aFrame, nsIFrameImageLoaderCB aCallBack, @@ -403,7 +407,6 @@ nsFrameImageLoader::GetIntrinsicSize(nsSize& aResult) PRUint32 width, height; float p2t; - mImageRequest->GetNaturalDimensions(&width, &height); mPresContext->GetScaledPixelsToTwips(&p2t); aResult.width = NSIntPixelsToTwips(width, p2t); aResult.height = NSIntPixelsToTwips(height, p2t); @@ -413,6 +416,20 @@ nsFrameImageLoader::GetIntrinsicSize(nsSize& aResult) return NS_OK; } +NS_IMETHODIMP +nsFrameImageLoader::GetNaturalImageSize(PRUint32* naturalWidth, + PRUint32 *naturalHeight) +{ + if(mImage){ + *naturalWidth = mImage->GetNaturalWidth(); + *naturalHeight = mImage->GetNaturalHeight(); + }else{ + *naturalWidth = 0; + *naturalHeight = 0; + } + return NS_OK; +} + void nsFrameImageLoader::Notify(nsIImageRequest *aImageRequest, nsIImage *aImage,