Bug 1740516 - Fire pageshow for an iframe before the pageshow for its parent window when coming out of BFCache with session history in parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131891
This commit is contained in:
@@ -2910,12 +2910,21 @@ void BrowsingContext::DidSet(FieldIndex<IDX_IsInBFCache>) {
|
||||
nsDocShell::Cast(mDocShell)->MaybeDisconnectChildListenersOnPageHide();
|
||||
}
|
||||
|
||||
PreOrderWalk([&](BrowsingContext* aContext) {
|
||||
nsCOMPtr<nsIDocShell> shell = aContext->GetDocShell();
|
||||
if (shell) {
|
||||
nsDocShell::Cast(shell)->FirePageHideShowNonRecursive(!isInBFCache);
|
||||
}
|
||||
});
|
||||
if (isInBFCache) {
|
||||
PreOrderWalk([&](BrowsingContext* aContext) {
|
||||
nsCOMPtr<nsIDocShell> shell = aContext->GetDocShell();
|
||||
if (shell) {
|
||||
nsDocShell::Cast(shell)->FirePageHideShowNonRecursive(false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
PostOrderWalk([&](BrowsingContext* aContext) {
|
||||
nsCOMPtr<nsIDocShell> shell = aContext->GetDocShell();
|
||||
if (shell) {
|
||||
nsDocShell::Cast(shell)->FirePageHideShowNonRecursive(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (isInBFCache) {
|
||||
PreOrderWalk([&](BrowsingContext* aContext) {
|
||||
|
||||
Reference in New Issue
Block a user