зеркало из https://github.com/mozilla/pjs.git
suppress the painting of partially decoded background images bug 129908; r=pavlov sr=attinasi a=asa
This commit is contained in:
Родитель
6b931ab48f
Коммит
66ae49ae82
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
//@}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче