From c8d10536804e8dfcb04fcef11d21e225f988bef2 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 22 May 2019 21:18:27 +0000 Subject: [PATCH] Bug 1552541. Consider document.domain when deciding on inner window reuse. r=bholley Differential Revision: https://phabricator.services.mozilla.com/D31857 --HG-- extra : moz-landing-system : lando --- dom/base/nsGlobalWindowOuter.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index bd11d1344e65..45655689e2f8 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -1537,10 +1537,8 @@ bool nsGlobalWindowOuter::WouldReuseInnerWindow(Document* aNewDocument) { return true; } - bool equal; - if (NS_SUCCEEDED(mDoc->NodePrincipal()->Equals(aNewDocument->NodePrincipal(), - &equal)) && - equal) { + if (BasePrincipal::Cast(mDoc->NodePrincipal()) + ->FastEqualsConsideringDomain(aNewDocument->NodePrincipal())) { // The origin is the same. return true; }