Bug 498976 - Scroll the selected tab into view on mouseover when it's only partially visible. r=dao
authorPremang <premangvikani@gmail.com>
Wed, 18 Jan 2017 17:31:26 +0100
changeset 375071 02c94a326f6dae12438b9c1b827b88db79bf78a0
parent 375070 c619c89829a77ae64b0d205a8c03f49283db921c
child 375072 338d4cec4ffd40a0b95b41c24ad57602b9032b27
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs498976
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 498976 - Scroll the selected tab into view on mouseover when it's only partially visible. r=dao
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -7033,16 +7033,20 @@
       <method name="_mouseenter">
         <body><![CDATA[
           if (this.hidden || this.closing)
             return;
 
           let tabContainer = this.parentNode;
           let visibleTabs = tabContainer.tabbrowser.visibleTabs;
           let tabIndex = visibleTabs.indexOf(this);
+
+          if (this.selected)
+            tabContainer._handleTabSelect();
+
           if (tabIndex == 0) {
             tabContainer._beforeHoveredTab = null;
           } else {
             let candidate = visibleTabs[tabIndex - 1];
             if (!candidate.selected) {
               tabContainer._beforeHoveredTab = candidate;
               candidate.setAttribute("beforehovered", "true");
             }