Bug 986472 - Ensure that touch points fall inside the element bounds when being moved. r=wesj
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -4737,18 +4737,18 @@ var BrowserEventHandler = {
break;
}
}
if (isTouchClick) {
let rect = rects[0];
// if either width or height is zero, we don't want to move the click to the edge of the element. See bug 757208
if (rect.width != 0 && rect.height != 0) {
- aX = Math.min(Math.floor(rect.left + rect.width), Math.max(Math.ceil(rect.left), aX));
- aY = Math.min(Math.floor(rect.top + rect.height), Math.max(Math.ceil(rect.top), aY));
+ aX = Math.min(Math.ceil(rect.left + rect.width) - 1, Math.max(Math.ceil(rect.left), aX));
+ aY = Math.min(Math.ceil(rect.top + rect.height) - 1, Math.max(Math.ceil(rect.top), aY));
}
}
}
return [aX, aY];
},
_sendMouseEvent: function _sendMouseEvent(aName, aElement, aX, aY) {
let window = aElement.ownerDocument.defaultView;