mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-30 12:27:29 +09:00
Bug 1341754: Provide a valid triggeringPrincipal when calling SetURI in Location
This commit is contained in:
parent
db41bf152a
commit
e45bad2c54
2 changed files with 14 additions and 6 deletions
|
|
@ -10402,10 +10402,13 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
||||||
* call OnNewURI() so that, this traversal will be
|
* call OnNewURI() so that, this traversal will be
|
||||||
* recorded in session and global history.
|
* recorded in session and global history.
|
||||||
*/
|
*/
|
||||||
nsCOMPtr<nsIPrincipal> triggeringPrincipal, principalToInherit;
|
nsCOMPtr<nsIPrincipal> newURITriggeringPrincipal, newURIPrincipalToInherit;
|
||||||
if (mOSHE) {
|
if (mOSHE) {
|
||||||
mOSHE->GetTriggeringPrincipal(getter_AddRefs(triggeringPrincipal));
|
mOSHE->GetTriggeringPrincipal(getter_AddRefs(newURITriggeringPrincipal));
|
||||||
mOSHE->GetPrincipalToInherit(getter_AddRefs(principalToInherit));
|
mOSHE->GetPrincipalToInherit(getter_AddRefs(newURIPrincipalToInherit));
|
||||||
|
} else {
|
||||||
|
newURITriggeringPrincipal = aTriggeringPrincipal;
|
||||||
|
newURIPrincipalToInherit = doc->NodePrincipal();
|
||||||
}
|
}
|
||||||
// Pass true for aCloneSHChildren, since we're not
|
// Pass true for aCloneSHChildren, since we're not
|
||||||
// changing documents here, so all of our subframes are
|
// changing documents here, so all of our subframes are
|
||||||
|
|
@ -10415,7 +10418,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
|
||||||
// flag on firing onLocationChange(...).
|
// flag on firing onLocationChange(...).
|
||||||
// Anyway, aCloneSHChildren param is simply reflecting
|
// Anyway, aCloneSHChildren param is simply reflecting
|
||||||
// doShortCircuitedLoad in this scope.
|
// doShortCircuitedLoad in this scope.
|
||||||
OnNewURI(aURI, nullptr, triggeringPrincipal, principalToInherit,
|
OnNewURI(aURI, nullptr, newURITriggeringPrincipal, newURIPrincipalToInherit,
|
||||||
mLoadType, true, true, true);
|
mLoadType, true, true, true);
|
||||||
|
|
||||||
nsCOMPtr<nsIInputStream> postData;
|
nsCOMPtr<nsIInputStream> postData;
|
||||||
|
|
|
||||||
|
|
@ -2521,8 +2521,13 @@ nsGlobalWindow::WouldReuseInnerWindow(nsIDocument* aNewDocument)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ASSERTION(NS_IsAboutBlank(mDoc->GetDocumentURI()),
|
#ifdef DEBUG
|
||||||
"How'd this happen?");
|
{
|
||||||
|
nsCOMPtr<nsIURI> uri;
|
||||||
|
mDoc->GetDocumentURI()->CloneIgnoringRef(getter_AddRefs(uri));
|
||||||
|
NS_ASSERTION(NS_IsAboutBlank(uri), "How'd this happen?");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Great, we're the original document, check for one of the other
|
// Great, we're the original document, check for one of the other
|
||||||
// conditions.
|
// conditions.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue