Bug 1321020 Part 1: Ensure that a new tab opened from content with non-default remote type, gets correct remote type. r=gijs
authorBob Owen <bobowencode@gmail.com>
Fri, 23 Dec 2016 12:27:03 +0000
changeset 327196 b50562f277da2f968c24b25e81253ad12c0fb7ee
parent 327195 2a762f5632902fe62907175d2872c2c307cf9ef8
child 327197 94dfb2c98d9ca64d986c0baff2abdd782c6bead7
push id31122
push userphilringnalda@gmail.com
push dateSun, 25 Dec 2016 00:51:37 +0000
treeherdermozilla-central@1156db49e976 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1321020
milestone53.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 1321020 Part 1: Ensure that a new tab opened from content with non-default remote type, gets correct remote type. r=gijs
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2235,16 +2235,25 @@
 
             var position = this.tabs.length - 1;
             t._tPos = position;
             t.permanentKey = {};
             this.tabContainer._setPositionalAttributes();
 
             this.tabContainer.updateVisibility();
 
+            // If URI is about:blank and we don't have a preferred remote type,
+            // then we need to use the referrer, if we have one, to get the
+            // correct remote type for the new tab.
+            if (uriIsAboutBlank && !aPreferredRemoteType && aReferrerURI) {
+              aPreferredRemoteType =
+                E10SUtils.getRemoteTypeForURI(aReferrerURI.spec,
+                                              gMultiProcessBrowser);
+            }
+
             // Currently in this incarnation of bug 906076, we are forcing the
             // browser to immediately be linked.  In future incarnations of this
             // bug this will be removed so we can leave the tab in its "lazy"
             // state to be exploited for startup optimization.  Note that for
             // now this must occur before "TabOpen" event is fired, as that will
             // trigger SessionStore.jsm to run code that expects the existence
             // of tab.linkedBrowser.
             let browserParams = {