[Pkg-mozext-commits] [tabmixplus] 87/107: Pending tab shrink for a moment when restoring starts, SessionStore change the title to 'Connecting…'. Don't remove tab width when widthFitTitle is true and the tab is restoring

David Prévot taffit at moszumanska.debian.org
Tue Dec 29 19:02:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit 05a718bf51c4710380a47b63061b6323fffc6639
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Nov 29 11:21:18 2015 +0200

    Pending tab shrink for a moment when restoring starts, SessionStore change the title to 'Connecting…'. Don't remove tab width when widthFitTitle is true and the tab is restoring
---
 chrome/content/minit/tablib.js | 21 ++++++++++++++++++---
 chrome/content/tab/tab.js      |  5 +++--
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index cb7b488..b4eb821 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -317,7 +317,7 @@ var tablib = { // eslint-disable-line
        if (aTab.hasAttribute("tabmix_changed_label")) {\
          aTab.removeAttribute("tabmix_changed_label");\
          if (noChange)\
-           tablib.onTabTitleChanged(aTab, title == urlTitle);\
+           tablib.onTabTitleChanged(aTab, browser, title == urlTitle);\
        }\
        else if (noChange)\
          TMP_Places.currentTab = null;\
@@ -325,7 +325,7 @@ var tablib = { // eslint-disable-line
     )._replace(
       'aTab.crop = crop;',
       '$&\
-       tablib.onTabTitleChanged(aTab, title == urlTitle);'
+       tablib.onTabTitleChanged(aTab, browser, title == urlTitle);'
     ).toCode();
 
     // after bug 347930 - change Tab strip to be a toolbar
@@ -1778,13 +1778,28 @@ var tablib = { // eslint-disable-line
     return TMP_Places.getTabTitle(aTab, url, title);
   },
 
-  onTabTitleChanged: function TMP_onTabTitleChanged(aTab, isUrlTitle) {
+  get labels() {
+    delete this.labels;
+    this.labels = [
+      gBrowser.mStringBundle.getString("tabs.connecting"),
+      gBrowser.mStringBundle.getString("tabs.emptyTabTitle"),
+    ];
+    return this.labels;
+  },
+
+  onTabTitleChanged: function TMP_onTabTitleChanged(aTab, aBrowser, isUrlTitle) {
     // when TabmixTabbar.widthFitTitle is true we only have width attribute after tab reload
     // some site, like Gmail change title internaly, after load already finished and we have remove
     // width attribute
     if (!TabmixTabbar.widthFitTitle || (isUrlTitle && aTab.hasAttribute("width")))
       return;
 
+    if (aBrowser.getAttribute("remote") == "true" &&
+        aBrowser.__SS_restoreState == 2 &&
+        this.labels.indexOf(aTab.label) > -1) {
+      return;
+    }
+
     if (aTab.hasAttribute("width")) {
       let width = aTab.boxObject.width;
       aTab.removeAttribute("width");
diff --git a/chrome/content/tab/tab.js b/chrome/content/tab/tab.js
index db0f9b1..e9579e7 100644
--- a/chrome/content/tab/tab.js
+++ b/chrome/content/tab/tab.js
@@ -2679,8 +2679,9 @@ var TabmixProgressListener = {
         if (!tab.hasAttribute("busy")) {
           TabmixSessionManager.tabLoaded(tab);
           // we need to remove width from tabs with url label from here
-          if (tab.hasAttribute("width"))
-            tablib.onTabTitleChanged(tab);
+          if (tab.hasAttribute("width")) {
+            tablib.onTabTitleChanged(tab, aBrowser);
+          }
         }
       }
       if ((aStateFlags & nsIWebProgressListener.STATE_IS_WINDOW) &&

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list