Bug 863515 - Switch usages of content.opener to gBrowser.selectedBrowser.hasContentOpener. r=felipe.
authorMike Conley <mconley@mozilla.com>
Fri, 08 May 2015 12:16:12 -0400
changeset 244040 b8965a7ca29d2e0adedbd506b0d23ca24cb385a0
parent 244039 fa82c160f25964aacfad42bc3ced33543fb1c0c9
child 244041 6f05d5562250a86c4354dc96533684c48112f6f8
push id28763
push userkwierso@gmail.com
push dateSat, 16 May 2015 00:21:43 +0000
treeherdermozilla-central@32976e27159e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs863515
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 863515 - Switch usages of content.opener to gBrowser.selectedBrowser.hasContentOpener. r=felipe.
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2384,19 +2384,18 @@ function URLBarSetURI(aURI) {
     let uri = aURI || gBrowser.currentURI;
     // Strip off "wyciwyg://" and passwords for the location bar
     try {
       uri = Services.uriFixup.createExposableURI(uri);
     } catch (e) {}
 
     // Replace initial page URIs with an empty string
     // only if there's no opener (bug 370555).
-    // Bug 863515 - Make content.opener checks work in electrolysis.
     if (gInitialPages.indexOf(uri.spec) != -1)
-      value = !gMultiProcessBrowser && content.opener ? uri.spec : "";
+      value = gBrowser.selectedBrowser.hasContentOpener ? uri.spec : "";
     else
       value = losslessDecodeURI(uri);
 
     valid = !isBlankPageURL(uri.spec);
   }
 
   gURLBar.value = value;
   gURLBar.valueIsTyped = !valid;
@@ -4153,17 +4152,17 @@ var XULBrowserWindow = {
     this.hideOverLinkImmediately = false;
 
     // We should probably not do this if the value has changed since the user
     // searched
     // Update urlbar only if a new page was loaded on the primary content area
     // Do not update urlbar if there was a subframe navigation
 
     if (aWebProgress.isTopLevel) {
-      if ((location == "about:blank" && (gMultiProcessBrowser || !content.opener)) ||
+      if ((location == "about:blank" && !gBrowser.selectedBrowser.hasContentOpener) ||
           location == "") {  // Second condition is for new tabs, otherwise
                              // reload function is enabled until tab is refreshed.
         this.reloadCommand.setAttribute("disabled", "true");
       } else {
         this.reloadCommand.removeAttribute("disabled");
       }
 
       if (gURLBar) {
@@ -6528,18 +6527,17 @@ function undoCloseWindow(aIndex) {
 function isTabEmpty(aTab) {
   if (aTab.hasAttribute("busy"))
     return false;
 
   let browser = aTab.linkedBrowser;
   if (!isBlankPageURL(browser.currentURI.spec))
     return false;
 
-  // Bug 863515 - Make content.opener checks work in electrolysis.
-  if (!gMultiProcessBrowser && browser.contentWindow.opener)
+  if (browser.hasContentOpener)
     return false;
 
   if (browser.canGoForward || browser.canGoBack)
     return false;
 
   return true;
 }