Bug 881244 - Port | Bug 878747 - browser.stop() call in addTab() is expensive and causes reflows | to SeaMonkey. r=IanN a=Callek for CLOSED TREE landing
authorPhoenix <pppx@i.com.ua>
Sun, 16 Jun 2013 17:03:28 +0300
changeset 15791 9c3f0e3ae8f090065c71c3f663d321169db0856d
parent 15790 da4044d7ffe02d39bda1374ae4062f522683d508
child 15792 00e582fb8c729bc441584d11d7b49ff6797bbed5
push id942
push userbugzilla@standard8.plus.com
push dateMon, 05 Aug 2013 19:15:38 +0000
treeherdercomm-beta@0e1a1c4a9f0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, Callek
bugs881244, 878747
Bug 881244 - Port | Bug 878747 - browser.stop() call in addTab() is expensive and causes reflows | to SeaMonkey. r=IanN a=Callek for CLOSED TREE landing
suite/browser/tabbrowser.xml
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -1367,16 +1367,21 @@
 
             var uniqueId = "panel" + this.nextTabNumber++;
             n.id = uniqueId;
             t.linkedPanel = uniqueId;
             t.linkedBrowser = b;
             if (t.previousSibling.selected)
               t.setAttribute("afterselected", true);
 
+            // Prevent the superfluous initial load of a blank document
+            // if we're going to load something other than about:blank.
+            if (!blank)
+              b.setAttribute("nodefaultsrc", "true");
+
             // NB: this appendChild call causes us to run constructors for the
             // browser element, which fires off a bunch of notifications. Some
             // of those notifications can cause code to run that inspects our
             // state, so it is important that the tab element is fully
             // initialized by this point.
             this.mPanelContainer.appendChild(n);
 
             b.addEventListener("DOMTitleChanged", this.onTitleChanged, true);
@@ -1394,21 +1399,16 @@
             const filter = Components.classes["@mozilla.org/appshell/component/browser-status-filter;1"]
                                      .createInstance(Components.interfaces.nsIWebProgress);
             filter.addProgressListener(tabListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
             b.webProgress.addProgressListener(filter, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
             this.mTabListeners[position] = tabListener;
             this.mTabFilters[position] = filter;
 
             if (!blank) {
-              // Stop the existing about:blank load.  Otherwise, if aURI
-              // doesn't stop in-progress loads on its own, we'll get into
-              // trouble with multiple parallel loads running at once.
-              b.stop();
-
               // pretend the user typed this so it'll be available till
               // the document successfully loads
               b.userTypedValue = aURI;
 
               let nsIWebNavigation = Components.interfaces.nsIWebNavigation;
               let flags = nsIWebNavigation.LOAD_FLAGS_NONE;
               if (aAllowThirdPartyFixup)
                 flags |= nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;