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 63608 47af4dfc6d169260cd2802924871b62634bf3d15
parent 63607 5f7ab12daeb4f5479eb6a7738e23a39e198df6fb
child 63609 2a2956f3eb47ecfb4aec852cf65200dd3129a360
push id19245
push usereakhgari@mozilla.com
push dateWed, 23 Mar 2011 21:40:43 +0000
treeherdermozilla-central@47af4dfc6d16 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs582216
milestone2.2a1pre
first release with
nightly win64
47af4dfc6d16 / 4.2a1pre / 20110323143737 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
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[({