diff --git a/modules/libpr0n/src/imgLoader.cpp b/modules/libpr0n/src/imgLoader.cpp index 17d79866b092..8deddb1e4be6 100644 --- a/modules/libpr0n/src/imgLoader.cpp +++ b/modules/libpr0n/src/imgLoader.cpp @@ -1815,8 +1815,8 @@ NS_IMETHODIMP imgLoader::LoadImageWithChannel(nsIChannel *channel, imgIDecoderOb nsCOMPtr loadGroup; channel->GetLoadGroup(getter_AddRefs(loadGroup)); - // XXX: It looks like the wrong load flags are being passed in... - requestFlags &= 0xFFFF; + // Filter out any load flags not from nsIRequest + requestFlags &= nsIRequest::LOAD_REQUESTMASK; nsresult rv = NS_OK; if (request) { diff --git a/netwerk/base/public/nsIRequest.idl b/netwerk/base/public/nsIRequest.idl index a7f114b38e57..76c4a585544b 100644 --- a/netwerk/base/public/nsIRequest.idl +++ b/netwerk/base/public/nsIRequest.idl @@ -135,6 +135,11 @@ interface nsIRequest : nsISupports */ attribute nsLoadFlags loadFlags; + /** + * Mask defining the bits reserved for nsIRequest LoadFlags + */ + const unsigned long LOAD_REQUESTMASK = 0xFFFF; + /************************************************************************** * Listed below are the various load flags which may be or'd together. */ diff --git a/netwerk/base/src/nsLoadGroup.cpp b/netwerk/base/src/nsLoadGroup.cpp index 643a64dab12d..11463197858b 100644 --- a/netwerk/base/src/nsLoadGroup.cpp +++ b/netwerk/base/src/nsLoadGroup.cpp @@ -506,7 +506,7 @@ nsLoadGroup::SetDefaultLoadRequest(nsIRequest *aRequest) // Mask off any bits that are not part of the nsIRequest flags. // in particular, nsIChannel::LOAD_DOCUMENT_URI... // - mLoadFlags &= 0xFFFF; + mLoadFlags &= nsIRequest::LOAD_REQUESTMASK; } // Else, do not change the group's load flags (see bug 95981) return NS_OK;