Bug 1383653 P2 - call tabbrowser-tab::finishUnselectedTabHoverTimer() at tabbrowser::updateCurrentBrowser(); r?dao draft
authorKaku Kuo <kaku@mozilla.com>
Fri, 28 Jul 2017 10:44:48 +0800
changeset 617175 d16a1d951627240fffee18eb9c12f63e8419c50e
parent 616806 7d76e23e42ca5dfff1e47d21da908b0b8fba9f2b
child 617176 d708dbb7c36683fc13f899d2b5dd7f2feaf3f057
push id70963
push userbmo:kaku@mozilla.com
push dateFri, 28 Jul 2017 02:58:58 +0000
reviewersdao
bugs1383653
milestone56.0a1
Bug 1383653 P2 - call tabbrowser-tab::finishUnselectedTabHoverTimer() at tabbrowser::updateCurrentBrowser(); r?dao The original caller is tabbrowser-tab::_visuallySelected setter. MozReview-Commit-ID: GjsYF1ko95x
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1201,16 +1201,21 @@
                   oldFindBar.findMode == oldFindBar.FIND_NORMAL &&
                   !oldFindBar.hidden)
                 this._lastFindValue = oldFindBar._findField.value;
 
               this.updateTitlebar();
 
               this.mCurrentTab.removeAttribute("titlechanged");
               this.mCurrentTab.removeAttribute("attention");
+
+              // The tab has been selected, it's not unselected anymore.
+              // (1) Call the current tab's finishUnselectedTabHoverTimer()
+              //     to save a telemetry record.
+              this.mCurrentTab.finishUnselectedTabHoverTimer();
             }
 
             // If the new tab is busy, and our current state is not busy, then
             // we need to fire a start to all progress listeners.
             const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
             if (this.mCurrentTab.hasAttribute("busy") && !this.mIsBusy) {
               this.mIsBusy = true;
               this._callProgressListeners(null, "onStateChange",
@@ -7475,21 +7480,16 @@
           if (val)
             this.setAttribute("visuallyselected", "true");
           else
             this.removeAttribute("visuallyselected");
           this.parentNode.tabbrowser._tabAttrModified(this, ["visuallyselected"]);
 
           this._setPositionAttributes(val);
 
-          // Tab becomes visible, it's not unselected anymore.
-          if (val) {
-            this.finishUnselectedTabHoverTimer();
-          }
-
           return val;
           ]]>
         </setter>
       </property>
 
       <property name="_selected">
         <setter>
           <![CDATA[