mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 05:44:10 +00:00
check a pref to determine whether CSS background images should block onload
(instead of an env var) bug 299681 patch by Christian Persch <chpe@gnome.org> r+sr=roc a=bsmedberg
This commit is contained in:
parent
42f548729f
commit
cdd39b8817
@ -377,14 +377,18 @@ nsCSSValue::Image::Image(nsIURI* aURI, const PRUnichar* aString,
|
||||
if (!mString)
|
||||
return;
|
||||
|
||||
// If Paint Forcing is enabled, then force all background image loads to
|
||||
// If the pref is enabled, force all background image loads to
|
||||
// complete before firing onload for the document. Otherwise, background
|
||||
// image loads are special and don't block onload.
|
||||
static PRBool bg_in_bg = !PR_GetEnv("MOZ_FORCE_PAINT_AFTER_ONLOAD");
|
||||
|
||||
PRInt32 loadFlag = (!aIsBGImage || !bg_in_bg)
|
||||
? (PRInt32)nsIRequest::LOAD_NORMAL
|
||||
: (PRInt32)nsIRequest::LOAD_BACKGROUND;
|
||||
PRInt32 loadFlag = (PRInt32)nsIRequest::LOAD_NORMAL;
|
||||
if (aIsBGImage) {
|
||||
static PRBool onloadAfterImageBackgroundLoads =
|
||||
nsContentUtils::GetBoolPref
|
||||
("layout.fire_onload_after_image_background_loads");
|
||||
if (!onloadAfterImageBackgroundLoads) {
|
||||
loadFlag = (PRInt32)nsIRequest::LOAD_BACKGROUND;
|
||||
}
|
||||
}
|
||||
|
||||
if (mURI &&
|
||||
nsContentUtils::CanLoadImage(mURI, aDocument, aDocument)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user