Bug 695763. Part 2. Invalidate list style images if they are not decoded and we are asked to do a sync decode. r=roc

This commit is contained in:
Seth Fowler 2013-06-22 11:30:57 -05:00
parent 4e6ae6ecfa
commit 79aee060df
2 changed files with 24 additions and 0 deletions

View File

@ -242,6 +242,15 @@ public:
return;
}
nsCOMPtr<imgIContainer> image = f->GetImage();
if (aBuilder->ShouldSyncDecodeImages() && image && !image->IsDecoded()) {
// If we are going to do a sync decode and we are not decoded then we are
// going to be drawing something different from what is currently there,
// so we add our bounds to the invalid region.
bool snap;
aInvalidRegion->Or(*aInvalidRegion, GetBounds(aBuilder, &snap));
}
return nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion);
}
};
@ -1614,6 +1623,18 @@ nsBulletFrame::SetFontSizeInflation(float aInflation)
Properties().Set(FontSizeInflationProperty(), u.p);
}
already_AddRefed<imgIContainer>
nsBulletFrame::GetImage() const
{
if (mImageRequest && StyleList()->GetListStyleImage()) {
nsCOMPtr<imgIContainer> imageCon;
mImageRequest->GetImage(getter_AddRefs(imageCon));
return imageCon.forget();
}
return nullptr;
}
nscoord
nsBulletFrame::GetBaseline() const
{

View File

@ -15,6 +15,7 @@
#include "imgIRequest.h"
#include "imgINotificationObserver.h"
class imgIContainer;
class imgRequestProxy;
#define BULLET_FRAME_IMAGE_LOADING NS_FRAME_STATE_BIT(63)
@ -101,6 +102,8 @@ public:
int32_t GetOrdinal() { return mOrdinal; }
already_AddRefed<imgIContainer> GetImage() const;
protected:
nsresult OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage);