Bug 525997: adjust row highlighting behaviour [r=mark.finkle]
--- a/mobile/chrome/content/InputHandler.js
+++ b/mobile/chrome/content/InputHandler.js
@@ -58,16 +58,19 @@ const kKineticUpdateInterval = 25;
const kDecelerationRate = .10;
// How sensitive kinetic scroll is to mouse movement
const kSpeedSensitivity = .8;
// How relevant x earlier milliseconds is to determining the speed.
const kTimeRelevance = .01;
+// Same as NS_EVENT_STATE_ACTIVE from nsIEventStateManager.h
+const kStateActive = 0x00000001;
+
/**
* InputHandler
*
* The input handler is an arbiter between the Fennec chrome window inputs and any
* registered input modules. It keeps an array of input module objects. Incoming
* input events are wrapped in an EventInfo object and passed down to the input modules
* in the order of the modules array. Every registed module thus gets called with
* an EventInfo for each event that the InputHandler is registered to listen for.
@@ -835,16 +838,17 @@ MouseModule.prototype = {
/**
* DragData handles processing drags on the screen, handling both
* locking of movement on one axis, and click detection.
*/
function DragData(owner, dragRadius) {
this._owner = owner;
this._dragRadius = dragRadius;
+ this._domUtils = Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils);
this.reset();
};
DragData.prototype = {
reset: function reset() {
this.dragging = false;
this.sX = null;
this.sY = null;
@@ -872,16 +876,22 @@ DragData.prototype = {
}
},
setDragPosition: function setDragPosition(sX, sY) {
// Check if drag is now a pan.
if (!this._isPan) {
let distanceSquared = (Math.pow(sX - this._originX, 2) + Math.pow(sY - this._originY, 2));
this._isPan = (distanceSquared > Math.pow(this._dragRadius, 2));
+ if (this._isPan) {
+ // dismiss the active state of the pan element
+ let target = document.documentElement;
+ let state = this._domUtils.getContentState(target);
+ this._domUtils.setContentState(target, state & kStateActive);
+ }
}
// If now a pan, mark previous position where panning was.
if (this._isPan) {
let absX = Math.abs(this._originX - sX);
let absY = Math.abs(this._originY - sY);
// After the first lock, see if locking decision should be reverted.