suppress the painting of partially decoded background images bug 129908; r=pavlov sr=attinasi a=asa

git-svn-id: svn://10.0.0.236/trunk@117288 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kmcclusk%netscape.com 2002-03-23 04:33:37 +00:00
parent 72d13a76e6
commit 87dc98ac69
6 changed files with 29 additions and 2 deletions

View File

@ -2752,7 +2752,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext,
if (req)
req->GetImageStatus(&status);
if (NS_FAILED(rv) || !req || !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) {
if (NS_FAILED(rv) || !req || !(status & imgIRequest::STATUS_FRAME_COMPLETE) || !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) {
if (!transparentBG) {
// The background color is rendered over the 'border' 'padding' and
// 'content' areas

View File

@ -164,6 +164,18 @@ NS_IMETHODIMP nsImageLoader::OnStopFrame(imgIRequest *aRequest, nsISupports *aCo
{
if (!mFrame)
return NS_ERROR_FAILURE;
#ifdef NS_DEBUG
// Make sure the image request status's STATUS_FRAME_COMPLETE flag has been set to ensure
// the image will be painted when invalidated
if (aRequest) {
PRUint32 status = imgIRequest::STATUS_ERROR;
nsresult rv = aRequest->GetImageStatus(&status);
if (NS_SUCCEEDED(rv)) {
NS_ASSERTION((status & imgIRequest::STATUS_FRAME_COMPLETE), "imgIRequest::STATUS_FRAME_COMPLETE not set");
}
}
#endif
// Draw the background image
RedrawDirtyFrame(nsnull);

View File

@ -164,6 +164,18 @@ NS_IMETHODIMP nsImageLoader::OnStopFrame(imgIRequest *aRequest, nsISupports *aCo
{
if (!mFrame)
return NS_ERROR_FAILURE;
#ifdef NS_DEBUG
// Make sure the image request status's STATUS_FRAME_COMPLETE flag has been set to ensure
// the image will be painted when invalidated
if (aRequest) {
PRUint32 status = imgIRequest::STATUS_ERROR;
nsresult rv = aRequest->GetImageStatus(&status);
if (NS_SUCCEEDED(rv)) {
NS_ASSERTION((status & imgIRequest::STATUS_FRAME_COMPLETE), "imgIRequest::STATUS_FRAME_COMPLETE not set");
}
}
#endif
// Draw the background image
RedrawDirtyFrame(nsnull);

View File

@ -2752,7 +2752,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext,
if (req)
req->GetImageStatus(&status);
if (NS_FAILED(rv) || !req || !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) {
if (NS_FAILED(rv) || !req || !(status & imgIRequest::STATUS_FRAME_COMPLETE) || !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) {
if (!transparentBG) {
// The background color is rendered over the 'border' 'padding' and
// 'content' areas

View File

@ -55,6 +55,7 @@ interface imgIRequest : nsIRequest
const long STATUS_LOAD_PARTIAL = 0x2;
const long STATUS_LOAD_COMPLETE = 0x4;
const long STATUS_ERROR = 0x8;
const long STATUS_FRAME_COMPLETE = 0x10;
//@}
/**

View File

@ -444,6 +444,8 @@ NS_IMETHODIMP imgRequest::OnStopFrame(imgIRequest *request, nsISupports *cx, gfx
LOG_SCOPE(gImgLog, "imgRequest::OnStopFrame");
mImageStatus |= imgIRequest::STATUS_FRAME_COMPLETE;
if (mCacheEntry) {
PRUint32 cacheSize = 0;