Bug 1506852 - Make sure to also clear opener in BrowsingContext. r=peterv

When calling nsGlobalWindowOuter::SetOpenerWindow with null we should
make sure to also clear BrowsingContext::mOpener.

Differential Revision: https://phabricator.services.mozilla.com/D11769

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Farre 2018-11-20 08:49:33 +00:00
Родитель 118f324018
Коммит c0cee4bbdc
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -2266,11 +2266,11 @@ nsGlobalWindowOuter::SetOpenerWindow(nsPIDOMWindowOuter* aOpener,
mOpener = opener.forget();
NS_ASSERTION(mOpener || !aOpener, "Opener must support weak references!");
if (mDocShell && aOpener) {
if (mDocShell) {
// TODO(farre): Here we really wish to only consider the case
// where 'aOriginalOpener' is false, and we also really want to
// move opener entirely to BrowsingContext. See bug 1502330.
GetBrowsingContext()->SetOpener(aOpener->GetBrowsingContext());
GetBrowsingContext()->SetOpener(aOpener ? aOpener->GetBrowsingContext() : nullptr);
}
// Check that the js visible opener matches! We currently don't depend on this