Bug 1415235 - Rename adjustTabstrip to _updateCloseButtons. r?florian draft
authorDão Gottwald <dao@mozilla.com>
Tue, 07 Nov 2017 18:35:30 +0100
changeset 694316 8b9e2c0051897c02eba0bb6454c5eb83b6421934
parent 694164 7851d6768dfd9fe5568d1315a98f142d9bb9234f
child 739316 289a158dd0d212b30176ffda1801a49b6a79221f
push id88108
push userdgottwald@mozilla.com
push dateTue, 07 Nov 2017 17:36:03 +0000
reviewersflorian
bugs1415235
milestone58.0a1
Bug 1415235 - Rename adjustTabstrip to _updateCloseButtons. r?florian MozReview-Commit-ID: GBL3qGVKyZc
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -255,17 +255,17 @@
 
           if (aTab.hidden)
             this.showTab(aTab);
 
           this.moveTabTo(aTab, this._numPinnedTabs);
           aTab.setAttribute("pinned", "true");
           this.tabContainer._unlockTabSizing();
           this.tabContainer._positionPinnedTabs();
-          this.tabContainer.adjustTabstrip();
+          this.tabContainer._updateCloseButtons();
 
           this.getBrowserForTab(aTab).messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: true })
 
           if (aTab.selected)
             this._setCloseKeyState(false);
 
           let event = document.createEvent("Events");
           event.initEvent("TabPinned", true, false);
@@ -279,17 +279,17 @@
           if (!aTab.pinned)
             return;
 
           this.moveTabTo(aTab, this._numPinnedTabs - 1);
           aTab.removeAttribute("pinned");
           aTab.style.marginInlineStart = "";
           this.tabContainer._unlockTabSizing();
           this.tabContainer._positionPinnedTabs();
-          this.tabContainer.adjustTabstrip();
+          this.tabContainer._updateCloseButtons();
 
           this.getBrowserForTab(aTab).messageManager.sendAsyncMessage("Browser:AppTab", { isAppTab: false })
 
           if (aTab.selected)
             this._setCloseKeyState(true);
 
           let event = document.createEvent("Events");
           event.initEvent("TabUnpinned", true, false);
@@ -3388,17 +3388,17 @@
             for (let i = aTab._tPos; i < this.tabs.length; i++)
               this.tabs[i]._tPos = i;
 
             if (!this._windowIsClosing) {
               if (wasPinned)
                 this.tabContainer._positionPinnedTabs();
 
               // update tab close buttons state
-              this.tabContainer.adjustTabstrip();
+              this.tabContainer._updateCloseButtons();
 
               setTimeout(function(tabs) {
                 tabs._lastTabClosedByMouse = false;
               }, 0, this.tabContainer);
             }
 
             // update tab positional properties and attributes
             this.selectedTab._selected = true;
@@ -3862,17 +3862,17 @@
       <method name="showTab">
         <parameter name="aTab"/>
         <body>
         <![CDATA[
           if (aTab.hidden) {
             aTab.removeAttribute("hidden");
             this._visibleTabs = null; // invalidate cache
 
-            this.tabContainer.adjustTabstrip();
+            this.tabContainer._updateCloseButtons();
 
             this.tabContainer._setPositionalAttributes();
 
             let event = document.createEvent("Events");
             event.initEvent("TabShow", true, false);
             aTab.dispatchEvent(event);
           }
         ]]>
@@ -3883,17 +3883,17 @@
         <parameter name="aTab"/>
         <body>
         <![CDATA[
           if (!aTab.hidden && !aTab.pinned && !aTab.selected &&
               !aTab.closing) {
             aTab.setAttribute("hidden", "true");
             this._visibleTabs = null; // invalidate cache
 
-            this.tabContainer.adjustTabstrip();
+            this.tabContainer._updateCloseButtons();
 
             this.tabContainer._setPositionalAttributes();
 
             let event = document.createEvent("Events");
             event.initEvent("TabHide", true, false);
             aTab.dispatchEvent(event);
           }
         ]]>
@@ -6398,17 +6398,17 @@
         <xul:spacer class="closing-tabs-spacer" anonid="closing-tabs-spacer"
                     style="width: 0;"/>
       </xul:arrowscrollbox>
     </content>
 
     <implementation implements="nsIDOMEventListener, nsIObserver">
       <constructor>
         <![CDATA[
-          this.mTabClipWidth = Services.prefs.getIntPref("browser.tabs.tabClipWidth");
+          this._tabClipWidth = Services.prefs.getIntPref("browser.tabs.tabClipWidth");
 
           let { restoreTabsButton } = this;
           restoreTabsButton.setAttribute("label", gTabBrowserBundle.GetStringFromName("tabs.restoreLastTabs"));
 
           var tab = this.firstChild;
           tab.label = gTabBrowserBundle.GetStringFromName("tabs.emptyTabTitle");
           tab.setAttribute("onerror", "this.removeAttribute('image');");
 
@@ -6666,17 +6666,17 @@
           if (this.childNodes.length - this.tabbrowser._removingTabs.length == 1)
             this.visible = window.toolbar.visible;
           else
             this.visible = true;
         ]]></body>
       </method>
 
       <field name="_closeButtonsUpdatePending">false</field>
-      <method name="adjustTabstrip">
+      <method name="_updateCloseButtons">
         <body><![CDATA[
           // If we're overflowing, tabs are at their minimum widths.
           if (this.getAttribute("overflow") == "true") {
             this.setAttribute("closebuttons", "activetab");
             return;
           }
 
           if (this._closeButtonsUpdatePending) {
@@ -6701,17 +6701,17 @@
               // remove close buttons from background tabs so that people don't
               // accidentally close tabs by selecting them.
               let rect = ele => {
                 return window.QueryInterface(Ci.nsIInterfaceRequestor)
                              .getInterface(Ci.nsIDOMWindowUtils)
                              .getBoundsWithoutFlushing(ele);
               };
               let tab = this.tabbrowser.visibleTabs[this.tabbrowser._numPinnedTabs];
-              if (tab && rect(tab).width <= this.mTabClipWidth) {
+              if (tab && rect(tab).width <= this._tabClipWidth) {
                 this.setAttribute("closebuttons", "activetab");
               } else {
                 this.removeAttribute("closebuttons");
               }
             });
           });
         ]]></body>
       </method>
@@ -6995,17 +6995,17 @@
               this.updateVisibility();
               TabsInTitlebar.init();
               break;
             case "resize":
               if (aEvent.target != window)
                 break;
 
               TabsInTitlebar.updateAppearance();
-              this.adjustTabstrip();
+              this._updateCloseButtons();
               this._handleTabSelect(true);
               this.updateSessionRestoreVisibility();
               break;
             case "mouseout":
               // If the "related target" (the node to which the pointer went) is not
               // a child of the current document, the mouse just left the window.
               let relatedTarget = aEvent.relatedTarget;
               if (relatedTarget && relatedTarget.ownerDocument == document)
@@ -7137,17 +7137,17 @@
       <method name="_handleNewTab">
         <parameter name="tab"/>
         <body><![CDATA[
           if (tab.parentNode != this)
             return;
           tab._fullyOpen = true;
           this.tabbrowser.tabAnimationsInProgress--;
 
-          this.adjustTabstrip();
+          this._updateCloseButtons();
 
           if (tab.getAttribute("selected") == "true") {
             this._handleTabSelect();
           } else if (!tab.hasAttribute("skipbackgroundnotify")) {
             this._notifyBackgroundTab(tab);
           }
 
           // XXXmano: this is a temporary workaround for bug 345399
@@ -7193,17 +7193,17 @@
       <handler event="transitionend"><![CDATA[
         if (event.propertyName != "max-width")
           return;
 
         var tab = event.target;
 
         if (tab.getAttribute("fadein") == "true") {
           if (tab._fullyOpen)
-            this.adjustTabstrip();
+            this._updateCloseButtons();
           else
             this._handleNewTab(tab);
         } else if (tab.closing) {
           this.tabbrowser._endRemoveTab(tab);
         }
       ]]></handler>
 
       <handler event="dblclick"><![CDATA[