зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
e9656e9eee
Коммит
7dfdbffda0
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче