Bug 582216 - Make sure that we set _scrollTarget in every case in order to address intermittent failures in tabbrowser overflow handling; r=dao
authorHiroyuki Ikezoe <hiikezoe@mozilla-japan.org>
Wed, 16 Mar 2011 18:01:34 -0400
changeset 63653 4203ab3adfde6258a261f5504a422667998c9999
parent 63652 5df1de0e6a68d50beae2ef5f39bc415c85bcb772
child 63654 905ba2a1095a85ad14451d760b72a29af75e1edb
push id19248
push usereakhgari@mozilla.com
push dateWed, 23 Mar 2011 23:19:35 +0000
treeherdermozilla-central@ab95ab9e389b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs582216
milestone2.0b13pre
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 582216 - Make sure that we set _scrollTarget in every case in order to address intermittent failures in tabbrowser overflow handling; r=dao
toolkit/content/widgets/scrollbox.xml
--- a/toolkit/content/widgets/scrollbox.xml
+++ b/toolkit/content/widgets/scrollbox.xml
@@ -242,32 +242,32 @@
               amountToScroll = this._isScrolling * STOP_DISTANCE;
           } else {
             return;
           }
 
           this._stopSmoothScroll();
 
           if (aSmoothScroll != false && this.smoothScroll) {
-            this._scrollTarget = element;
-            this._smoothScrollByPixels(amountToScroll);
+            this._smoothScrollByPixels(amountToScroll, element);
           } else {
             this.scrollByPixels(amountToScroll);
           }
         ]]></body>
       </method>
 
       <method name="_smoothScrollByPixels">
         <parameter name="amountToScroll"/>
+        <parameter name="element"/><!-- optional -->
         <body><![CDATA[
+          this._stopSmoothScroll();
           if (amountToScroll == 0)
             return;
 
-          this._stopSmoothScroll();
-
+          this._scrollTarget = element;
           // Positive amountToScroll makes us scroll right (elements fly left), negative scrolls left.
           this._isScrolling = amountToScroll < 0 ? -1 : 1;
 
           this._scrollAnim.start(amountToScroll);
         ]]></body>
       </method>
 
       <field name="_scrollAnim"><![CDATA[({