Bug 1552541. Consider document.domain when deciding on inner window reuse. r=bholley a=jcristau
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 22 May 2019 21:18:27 +0000
changeset 536712 9b3c45bd2e778ae1ab2da8d4a79d3771619d626b
parent 536711 59e67467da702a3b571d4733c4bd468a9f71ad56
child 536713 88114c48b1eeac094cd9bc707f0029dd8dc8e857
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, jcristau
bugs1552541
milestone68.0
Bug 1552541. Consider document.domain when deciding on inner window reuse. r=bholley a=jcristau Differential Revision: https://phabricator.services.mozilla.com/D31857
dom/base/nsGlobalWindowOuter.cpp
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -1532,20 +1532,18 @@ bool nsGlobalWindowOuter::WouldReuseInne
 
   // Great, we're the original document, check for one of the other
   // conditions.
 
   if (mDoc == 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;
   }
 
   return false;
 }
 
 void nsGlobalWindowOuter::SetInitialPrincipalToSubject() {