Back out 97a7a9f80725 (Bug 639179 Part 4) due to mobile unittest orange.
authorL. David Baron <dbaron@dbaron.org>
Sat, 09 Apr 2011 18:22:29 -0700
changeset 67751 f91f9993012233b3d8a1a1a013c2219a783bfec9
parent 67750 91b90242f8822434681fe37ab20b53a1320618f8
child 67752 1bbb4c7ec2d71f8f5ba295150db35e29020138a4
push id19423
push userdbaron@mozilla.com
push dateSun, 10 Apr 2011 01:26:15 +0000
treeherdermozilla-central@fe3f7889918b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs639179
milestone2.2a1pre
backs out97a7a9f807250dfd079551c0c5c5c97a4bde29a4
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
Back out 97a7a9f80725 (Bug 639179 Part 4) due to mobile unittest orange.
mobile/app/mobile.js
mobile/chrome/content/input.js
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -392,16 +392,17 @@ pref("dom.max_chrome_script_run_time", 0
 pref("dom.max_script_run_time", 20);
 
 // JS error console
 pref("devtools.errorconsole.enabled", false);
 
 // kinetic tweakables
 pref("browser.ui.kinetic.updateInterval", 30);
 pref("browser.ui.kinetic.decelerationRate", 20);
+pref("browser.ui.kinetic.speedSensitivity", 80);
 pref("browser.ui.kinetic.swipeLength", 160);
 
 // zooming
 pref("browser.ui.zoom.pageFitGranularity", 9); // don't zoom to fit by less than 1/9 (11%)
 pref("browser.ui.zoom.animationDuration", 200); // ms duration of double-tap zoom animation
 pref("browser.ui.zoom.reflow", false); // Change text wrapping on double-tap
 pref("browser.ui.zoom.reflow.fontSize", 720);
 
--- a/mobile/chrome/content/input.js
+++ b/mobile/chrome/content/input.js
@@ -831,16 +831,18 @@ function KineticController(aPanBy, aEndC
   this._time = 0;
   this._timeStart = 0;
 
   // How often do we change the position of the scroll pane?  Too often and panning may jerk near
   // the end. Too little and panning will be choppy. In milliseconds.
   this._updateInterval = Services.prefs.getIntPref("browser.ui.kinetic.updateInterval");
   // "Friction" of the scroll pane. The lower, the less friction and the further distance traveled.
   this._decelerationRate = Services.prefs.getIntPref("browser.ui.kinetic.decelerationRate") / 10000;
+  // A multiplier for the initial velocity of the movement.
+  this._speedSensitivity = Services.prefs.getIntPref("browser.ui.kinetic.speedSensitivity") / 100;
   // Number of milliseconds that can contain a swipe. Movements earlier than this are disregarded.
   this._swipeLength = Services.prefs.getIntPref("browser.ui.kinetic.swipeLength");
 
   this._reset();
 }
 
 KineticController.prototype = {
   _reset: function _reset() {
@@ -976,19 +978,18 @@ KineticController.prototype = {
       currentVelocityY = Util.clamp(this._velocity.y + this._acceleration.y * currentTime, -kMaxVelocity, kMaxVelocity);
     }
 
     if (currentVelocityX * this._velocity.x <= 0)
       currentVelocityX = 0;
     if (currentVelocityY * this._velocity.y <= 0)
       currentVelocityY = 0;
 
-    let swipeTime = Math.min(swipeLength, lastTime - mb[0].t);
-    this._velocity.x = clampFromZero((distanceX / swipeTime) + currentVelocityX, Math.abs(currentVelocityX), 6);
-    this._velocity.y = clampFromZero((distanceY / swipeTime) + currentVelocityY, Math.abs(currentVelocityY), 6);
+    this._velocity.x = clampFromZero((distanceX / swipeLength) + currentVelocityX, Math.abs(currentVelocityX), kMaxVelocity);
+    this._velocity.y = clampFromZero((distanceY / swipeLength) + currentVelocityY, Math.abs(currentVelocityY), kMaxVelocity);
 
     // Set acceleration vector to opposite signs of velocity
     this._acceleration.set(this._velocity.clone().map(sign).scale(-this._decelerationRate));
 
     this._position.set(0, 0);
     this._initialTime = mozAnimationStartTime;
     this._time = 0;
     this.momentumBuffer = [];