Bug 230697. Extend MOZ_FORCE_PAINT_AFTER_ONLOAD so that CSS background image loads delay firing of the onload event. r+sr=bz

This commit is contained in:
roc+%cs.cmu.edu 2004-02-20 06:00:35 +00:00
Родитель e9656e9eee
Коммит 7dfdbffda0
4 изменённых файлов: 34 добавлений и 6 удалений

Просмотреть файл

@ -944,7 +944,12 @@ DocumentViewerImpl::LoadComplete(nsresult aStatus)
if (mPresShell) {
mPresShell->FlushPendingNotifications(PR_TRUE);
}
printf("GECKO: PAINT FORCED AFTER ONLOAD\n");
nsIURI *uri = mDocument->GetDocumentURI();
nsCAutoString spec;
if (uri) {
uri->GetSpec(spec);
}
printf("GECKO: PAINT FORCED AFTER ONLOAD: %s\n", spec.get());
fflush(stdout);
}

Просмотреть файл

@ -944,7 +944,12 @@ DocumentViewerImpl::LoadComplete(nsresult aStatus)
if (mPresShell) {
mPresShell->FlushPendingNotifications(PR_TRUE);
}
printf("GECKO: PAINT FORCED AFTER ONLOAD\n");
nsIURI *uri = mDocument->GetDocumentURI();
nsCAutoString spec;
if (uri) {
uri->GetSpec(spec);
}
printf("GECKO: PAINT FORCED AFTER ONLOAD: %s\n", spec.get());
fflush(stdout);
}

Просмотреть файл

@ -41,6 +41,9 @@
#include "nsStyleContext.h"
// Paint forcing
#include "prenv.h"
NS_IMPL_ISUPPORTS2(nsImageLoader, imgIDecoderObserver, imgIContainerObserver)
nsImageLoader::nsImageLoader() :
@ -114,10 +117,16 @@ nsImageLoader::Load(nsIURI *aURI)
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
if (NS_FAILED(rv)) return rv;
// If Paint Forcing is enabled, then force all background image loads
// to complete before firing onload for the document
static PRInt32 loadFlag
= PR_GetEnv("MOZ_FORCE_PAINT_AFTER_ONLOAD")
? (PRInt32)nsIRequest::LOAD_NORMAL
: (PRInt32)nsIRequest::LOAD_BACKGROUND;
// XXX: initialDocumentURI is NULL!
return il->LoadImage(aURI, nsnull, doc->GetDocumentURI(), loadGroup,
this,
doc, nsIRequest::LOAD_BACKGROUND, nsnull, nsnull,
this, doc, loadFlag, nsnull, nsnull,
getter_AddRefs(mRequest));
}

Просмотреть файл

@ -41,6 +41,9 @@
#include "nsStyleContext.h"
// Paint forcing
#include "prenv.h"
NS_IMPL_ISUPPORTS2(nsImageLoader, imgIDecoderObserver, imgIContainerObserver)
nsImageLoader::nsImageLoader() :
@ -114,10 +117,16 @@ nsImageLoader::Load(nsIURI *aURI)
nsCOMPtr<imgILoader> il(do_GetService("@mozilla.org/image/loader;1", &rv));
if (NS_FAILED(rv)) return rv;
// If Paint Forcing is enabled, then force all background image loads
// to complete before firing onload for the document
static PRInt32 loadFlag
= PR_GetEnv("MOZ_FORCE_PAINT_AFTER_ONLOAD")
? (PRInt32)nsIRequest::LOAD_NORMAL
: (PRInt32)nsIRequest::LOAD_BACKGROUND;
// XXX: initialDocumentURI is NULL!
return il->LoadImage(aURI, nsnull, doc->GetDocumentURI(), loadGroup,
this,
doc, nsIRequest::LOAD_BACKGROUND, nsnull, nsnull,
this, doc, loadFlag, nsnull, nsnull,
getter_AddRefs(mRequest));
}