diff --git a/dom/xslt/base/txURIUtils.cpp b/dom/xslt/base/txURIUtils.cpp index b74f063ca58a..ebcc484d21d6 100644 --- a/dom/xslt/base/txURIUtils.cpp +++ b/dom/xslt/base/txURIUtils.cpp @@ -59,16 +59,17 @@ URIUtils::ResetWithSource(nsIDocument *aNewDoc, nsIDOMNode *aSourceNode) nsCOMPtr channel = sourceDoc->GetChannel(); if (!channel) { // Need to synthesize one - if (NS_FAILED(NS_NewChannel(getter_AddRefs(channel), + nsresult rv = NS_NewChannel(getter_AddRefs(channel), sourceDoc->GetDocumentURI(), - nullptr, - loadGroup))) { + sourceDoc, + nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL, + nsIContentPolicy::TYPE_OTHER, + nullptr, // aChannelPolicy + loadGroup); + + if (NS_FAILED(rv)) { return; } - nsCOMPtr loadInfo = - new LoadInfo(sourcePrincipal, LoadInfo::eInheritPrincipal, - LoadInfo::eNotSandboxed); - channel->SetLoadInfo(loadInfo); } aNewDoc->Reset(channel, loadGroup); aNewDoc->SetPrincipal(sourcePrincipal); diff --git a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp index b848696ae809..eba3683645c6 100644 --- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp +++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp @@ -456,7 +456,12 @@ txCompileObserver::startLoad(nsIURI* aUri, txStylesheetCompiler* aCompiler, nsIPrincipal* aReferrerPrincipal) { nsCOMPtr channel; - nsresult rv = NS_NewChannel(getter_AddRefs(channel), aUri); + nsresult rv = NS_NewChannel(getter_AddRefs(channel), + aUri, + aReferrerPrincipal, + nsILoadInfo::SEC_NORMAL, + nsIContentPolicy::TYPE_STYLESHEET); + NS_ENSURE_SUCCESS(rv, rv); channel->SetLoadGroup(mLoadGroup);