From 47b8abd553485ee6a7c8f8b7679db1f1752bfeb2 Mon Sep 17 00:00:00 2001 From: Cameron Kaiser Date: Sun, 23 Sep 2018 17:42:27 -0700 Subject: [PATCH] #399: M1342849 --- browser/base/content/tabbrowser.xml | 15 +++++++++++---- browser/components/sessionstore/SessionStore.jsm | 1 + browser/components/sessionstore/TabAttributes.jsm | 3 ++- browser/themes/osx/browser.css | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index c454a3e1d..25e54d70b 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -1763,6 +1763,7 @@ let remote = false; var aForceNotRemote; var aNoReferrer; var aUserContextId; + var aSkipBackgroundNotify; if (arguments.length == 2 && typeof arguments[1] == "object" && !(arguments[1] instanceof Ci.nsIURI)) { @@ -1780,6 +1781,7 @@ let remote = false; aForceNotRemote = params.forceNotRemote; aNoReferrer = params.noReferrer; aUserContextId = params.userContextId; + aSkipBackgroundNotify = params.skipBackgroundNotify; } // if we're adding tabs, we're past interrupt mode, ditch the owner @@ -1794,6 +1796,11 @@ let remote = false; t.setAttribute("usercontextid", aUserContextId); t.setAttribute("crop", "end"); t.setAttribute("onerror", "this.removeAttribute('image');"); + + if (aSkipBackgroundNotify) { + t.setAttribute("skipbackgroundnotify", true); + } + t.className = "tabbrowser-tab"; // The new browser should be remote if this is an e10s window and @@ -5184,10 +5191,10 @@ let remote = false; selected.left - scrollRect.left); } - if (!this._animateElement.hasAttribute("notifybgtab")) { - this._animateElement.setAttribute("notifybgtab", "true"); + if (!this._animateElement.hasAttribute("highlight")) { + this._animateElement.setAttribute("highlight", "true"); setTimeout(function (ele) { - ele.removeAttribute("notifybgtab"); + ele.removeAttribute("highlight"); }, 150, this._animateElement); } ]]> @@ -5278,7 +5285,7 @@ let remote = false; if (tab.getAttribute("selected") == "true") { //this._fillTrailingGap(); this._handleTabSelect(); - } else { + } else if (!tab.hasAttribute("skipbackgroundnotify")) { this._notifyBackgroundTab(tab); } diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm index 48c054b3c..bfd0bb873 100644 --- a/browser/components/sessionstore/SessionStore.jsm +++ b/browser/components/sessionstore/SessionStore.jsm @@ -2932,6 +2932,7 @@ var SessionStoreInternal = { tabbrowser.addTab("about:blank", { skipAnimation: true, forceNotRemote: true, + skipBackgroundNotify: true, })); if (winData.tabs[t].pinned) diff --git a/browser/components/sessionstore/TabAttributes.jsm b/browser/components/sessionstore/TabAttributes.jsm index b33bcb779..9beda5ec1 100644 --- a/browser/components/sessionstore/TabAttributes.jsm +++ b/browser/components/sessionstore/TabAttributes.jsm @@ -32,7 +32,8 @@ var TabAttributesInternal = { // 'muted' should not be accessed directly but handled by using the // tab.linkedBrowser.audioMuted/toggleMuteAudio methods. // 'pending' is used internal by sessionstore and managed accordingly. - _skipAttrs: new Set(["image", "muted", "pending"]), + // 'skipbackgroundnotify' is used to speed up startup time (bug 1342849). + _skipAttrs: new Set(["image", "muted", "pending", "skipbackgroundnotify"]), persist: function (name) { if (this._attrs.has(name) || this._skipAttrs.has(name)) { diff --git a/browser/themes/osx/browser.css b/browser/themes/osx/browser.css index ab4a66578..0c205652f 100644 --- a/browser/themes/osx/browser.css +++ b/browser/themes/osx/browser.css @@ -2645,7 +2645,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker { transition: 1s background-color ease-out; } -.tabbrowser-arrowscrollbox > .scrollbutton-down[notifybgtab] { +.tabbrowser-arrowscrollbox > .scrollbutton-down[highlight] { background-color: Highlight; transition: none; }