зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1510928 - Don't assert when setting opener to closed window. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D13529 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
e0ef65f04a
Коммит
1fc714c017
|
@ -2226,9 +2226,16 @@ void nsGlobalWindowOuter::SetOpenerWindow(nsPIDOMWindowOuter* aOpener,
|
||||||
NS_ASSERTION(mOpener || !aOpener, "Opener must support weak references!");
|
NS_ASSERTION(mOpener || !aOpener, "Opener must support weak references!");
|
||||||
|
|
||||||
if (mDocShell) {
|
if (mDocShell) {
|
||||||
MOZ_DIAGNOSTIC_ASSERT(!aOriginalOpener || !aOpener ||
|
MOZ_DIAGNOSTIC_ASSERT(
|
||||||
aOpener->GetBrowsingContext() ==
|
!aOriginalOpener || !aOpener ||
|
||||||
GetBrowsingContext()->GetOpener());
|
// TODO(farre): Allowing to set a closed or closing window as
|
||||||
|
// opener is not ideal, since it won't have a docshell and
|
||||||
|
// therefore no browsing context. This means that we're
|
||||||
|
// effectively setting the browsing context opener to null and
|
||||||
|
// the window opener to a closed window. This needs to be
|
||||||
|
// cleaned up, see Bug 1511353.
|
||||||
|
nsGlobalWindowOuter::Cast(aOpener)->IsClosedOrClosing() ||
|
||||||
|
aOpener->GetBrowsingContext() == GetBrowsingContext()->GetOpener());
|
||||||
// TODO(farre): Here we really wish to only consider the case
|
// TODO(farre): Here we really wish to only consider the case
|
||||||
// where 'aOriginalOpener'. See bug 1509016.
|
// where 'aOriginalOpener'. See bug 1509016.
|
||||||
GetBrowsingContext()->SetOpener(aOpener ? aOpener->GetBrowsingContext()
|
GetBrowsingContext()->SetOpener(aOpener ? aOpener->GetBrowsingContext()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче