From f0625c4110fb7f53fab14570ceca400fb3af2865 Mon Sep 17 00:00:00 2001 From: "pnunn%netscape.com" Date: Fri, 17 Mar 2000 00:13:04 +0000 Subject: [PATCH] bug#29853. r:davidm. preserves background loading attribute when imglib sets load attributes from imglib reload policies. pnunn git-svn-id: svn://10.0.0.236/trunk@63209 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/src/nsImageNetContextAsync.cpp | 37 ++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/mozilla/gfx/src/nsImageNetContextAsync.cpp b/mozilla/gfx/src/nsImageNetContextAsync.cpp index 0c1b247a6f8..7a80f816eaa 100644 --- a/mozilla/gfx/src/nsImageNetContextAsync.cpp +++ b/mozilla/gfx/src/nsImageNetContextAsync.cpp @@ -697,26 +697,31 @@ ImageNetContextImpl::GetURL (ilIURL * aURL, if (bIsBackground) { (void)channel->SetLoadAttributes(nsIChannel::LOAD_BACKGROUND); } + + nsLoadFlags flags; + rv = channel->GetLoadAttributes(&flags); + if (NS_FAILED(rv)) return rv; + switch(aLoadMethod){ - case IMG_CACHE_ONLY: - /* should never get here, but don't fail if you do. */ - case IMG_NTWK_SERVER: - (void)channel->SetLoadAttributes(nsIChannel::VALIDATE_NEVER); - break; + case IMG_CACHE_ONLY: + /* shouldn't get here, but don't fail if you do. Just fall to the next case. */ + case IMG_NTWK_SERVER: + (void)channel->SetLoadAttributes((nsIChannel::VALIDATE_NEVER) | flags); + break; - case TV_IMG_NTWK_SERVER: - case TV_NTWK_SERVER_ONLY: - (void)channel->SetLoadAttributes(nsIChannel::FORCE_VALIDATION); - break; + case TV_IMG_NTWK_SERVER: + case TV_NTWK_SERVER_ONLY: + (void)channel->SetLoadAttributes((nsIChannel::FORCE_VALIDATION) | flags); + break; - case SERVER_ONLY: - (void)channel->SetLoadAttributes(nsIChannel::FORCE_RELOAD); - break; - - default: - break; - } + case SERVER_ONLY: + (void)channel->SetLoadAttributes((nsIChannel::FORCE_RELOAD) | flags); + break; + default: + break; + } + nsCOMPtr window (do_QueryInterface(NS_STATIC_CAST(nsIStreamListener *, ic))); // let's try uri dispatching...