Bug 196072. Don't invalidate image area when incoming image data is for different frame. r=pavlov sr=bz

This commit is contained in:
paper%animecity.nu 2003-03-05 23:55:53 +00:00
parent 6b82121a51
commit fc57a6c25f
2 changed files with 26 additions and 0 deletions

View File

@ -95,6 +95,7 @@
#include "nsCSSFrameConstructor.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "gfxIImageFrame.h"
#ifdef DEBUG
#undef NOISY_IMAGE_LOADING
@ -438,6 +439,18 @@ NS_IMETHODIMP nsImageFrame::OnDataAvailable(imgIRequest *aRequest,
if (whichLoad != 0) return NS_OK;
struct ImageLoad *load= &mLoads[whichLoad];
// Don't invalidate if the current visible frame isn't the one the data is
// from
if (load->mRequest) {
nsCOMPtr<imgIContainer> container;
load->mRequest->GetImage(getter_AddRefs(container));
if (container) {
nsCOMPtr<gfxIImageFrame> gfxImgFrame;
container->GetCurrentFrame(getter_AddRefs(gfxImgFrame));
if (gfxImgFrame != aFrame)
return NS_OK;
}
}
nsRect r(aRect->x, aRect->y, aRect->width, aRect->height);

View File

@ -95,6 +95,7 @@
#include "nsCSSFrameConstructor.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "gfxIImageFrame.h"
#ifdef DEBUG
#undef NOISY_IMAGE_LOADING
@ -438,6 +439,18 @@ NS_IMETHODIMP nsImageFrame::OnDataAvailable(imgIRequest *aRequest,
if (whichLoad != 0) return NS_OK;
struct ImageLoad *load= &mLoads[whichLoad];
// Don't invalidate if the current visible frame isn't the one the data is
// from
if (load->mRequest) {
nsCOMPtr<imgIContainer> container;
load->mRequest->GetImage(getter_AddRefs(container));
if (container) {
nsCOMPtr<gfxIImageFrame> gfxImgFrame;
container->GetCurrentFrame(getter_AddRefs(gfxImgFrame));
if (gfxImgFrame != aFrame)
return NS_OK;
}
}
nsRect r(aRect->x, aRect->y, aRect->width, aRect->height);