mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 07:40:42 +00:00
Bug 196072. Don't invalidate image area when incoming image data is for different frame. r=pavlov sr=bz
This commit is contained in:
parent
6b82121a51
commit
fc57a6c25f
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user