mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1247872. Just get our private browsing state directly off the docshells we already have instead of trying to indirect through their documents. r=smaug
This commit is contained in:
parent
b07cce927c
commit
56064db6ce
@ -3492,22 +3492,19 @@ nsDocShell::CanAccessItem(nsIDocShellTreeItem* aTargetItem,
|
|||||||
|
|
||||||
nsCOMPtr<nsIDocShell> targetDS = do_QueryInterface(aTargetItem);
|
nsCOMPtr<nsIDocShell> targetDS = do_QueryInterface(aTargetItem);
|
||||||
nsCOMPtr<nsIDocShell> accessingDS = do_QueryInterface(aAccessingItem);
|
nsCOMPtr<nsIDocShell> accessingDS = do_QueryInterface(aAccessingItem);
|
||||||
if (!!targetDS != !!accessingDS) {
|
if (!targetDS || !accessingDS) {
|
||||||
// We must be able to convert both or neither to nsIDocShell.
|
// We must be able to convert both to nsIDocShell.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetDS && accessingDS &&
|
if (targetDS->GetIsInBrowserElement() != accessingDS->GetIsInBrowserElement() ||
|
||||||
(targetDS->GetIsInBrowserElement() !=
|
targetDS->GetAppId() != accessingDS->GetAppId()) {
|
||||||
accessingDS->GetIsInBrowserElement() ||
|
|
||||||
targetDS->GetAppId() != accessingDS->GetAppId())) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A private document can't access a non-private one, and vice versa.
|
// A private document can't access a non-private one, and vice versa.
|
||||||
if (aTargetItem->GetDocument()->GetLoadContext()->UsePrivateBrowsing() !=
|
if (static_cast<nsDocShell*>(targetDS.get())->UsePrivateBrowsing() !=
|
||||||
aAccessingItem->GetDocument()->GetLoadContext()->UsePrivateBrowsing())
|
static_cast<nsDocShell*>(accessingDS.get())->UsePrivateBrowsing()) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user