зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1646567 - fix nsDocShell::HasUnloadedParent to work for OOP frames. r=nika
With fission enabled, walking the docshell tree to find unloaded parents would stop at the first OOP parent. Instead we now walk the `BrowsingContext`/`WindowContext` tree. To still check parents which are OOP, we take advantage of the fact that a parent `WindowContext` will no longer be the current `WindowContext` if the parent was unloaded. For in process docshell's we additionally check the docshell directly. Differential Revision: https://phabricator.services.mozilla.com/D85328
This commit is contained in:
Родитель
dd996a396b
Коммит
ae5aa0f5bf
|
@ -12509,14 +12509,20 @@ nsDocShell::GetAsyncPanZoomEnabled(bool* aOut) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nsDocShell::HasUnloadedParent() {
|
bool nsDocShell::HasUnloadedParent() {
|
||||||
RefPtr<nsDocShell> parent = GetInProcessParentDocshell();
|
for (WindowContext* wc = GetBrowsingContext()->GetParentWindowContext(); wc;
|
||||||
while (parent) {
|
wc->GetParentWindowContext()) {
|
||||||
bool inUnload = false;
|
if (wc->IsCached() || wc->IsDiscarded() ||
|
||||||
parent->GetIsInUnload(&inUnload);
|
wc->GetBrowsingContext()->IsDiscarded()) {
|
||||||
if (inUnload) {
|
// If a parent is OOP and the parent WindowContext is no
|
||||||
|
// longer current, we can assume the parent was unloaded.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wc->GetBrowsingContext()->IsInProcess() &&
|
||||||
|
(!wc->GetBrowsingContext()->GetDocShell() ||
|
||||||
|
wc->GetBrowsingContext()->GetDocShell()->GetIsInUnload())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
parent = parent->GetInProcessParentDocshell();
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -460,7 +460,7 @@ interface nsIDocShell : nsIDocShellTreeItem
|
||||||
* Find out whether the docshell is currently in the middle of a page
|
* Find out whether the docshell is currently in the middle of a page
|
||||||
* transition. This is set just before the pagehide/unload events fire.
|
* transition. This is set just before the pagehide/unload events fire.
|
||||||
*/
|
*/
|
||||||
readonly attribute boolean isInUnload;
|
[infallible] readonly attribute boolean isInUnload;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disconnects this docshell's editor from its window, and stores the
|
* Disconnects this docshell's editor from its window, and stores the
|
||||||
|
|
Загрузка…
Ссылка в новой задаче