Bug 986472 - Ensure that touch points fall inside the element bounds when being moved. r=wesj
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 21 Mar 2014 11:45:30 -0400
changeset 174819 543b53ca78605c1c1b89bfd429718c26a8072c26
parent 174818 fb2e04672ea6268aee199d1ca80b5dc1a2168862
child 174820 0bab11fe296ad81633094e17a16dddb0fec1aec5
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerswesj
bugs986472
milestone31.0a1
Bug 986472 - Ensure that touch points fall inside the element bounds when being moved. r=wesj
mobile/android/chrome/content/browser.js
--- 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;