Bug 563759 - Incorrect arguments to nodesFromRect [r=vingtetun]
authorMatt Brubeck <mbrubeck@mozilla.com>
Wed, 12 May 2010 12:17:54 -0400
changeset 1567 9772d862d2da6fd19ddadd5edeeb99dc43c4c65e
parent 1566 05eb53701e0bdde91bb158eeaa54a4ab4652bb4b
child 1568 9bc18542690d7c46c0dfb79c93c36fe514fbb912
push id1408
push usermfinkle@mozilla.com
push dateWed, 12 May 2010 16:18:13 +0000
reviewersvingtetun
bugs563759
Bug 563759 - Incorrect arguments to nodesFromRect [r=vingtetun]
app/mobile.js
chrome/content/browser.js
--- a/app/mobile.js
+++ b/app/mobile.js
@@ -362,21 +362,21 @@ pref("browser.console.showInPanel", fals
 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", 10); // don't zoom to fit by less than 1/10.
 
-// Touch radius
+// Touch radius (area around the touch location to look for target elements):
 pref("browser.ui.touch.left", 8);
 pref("browser.ui.touch.right", 8);
-pref("browser.ui.touch.top", 4);
-pref("browser.ui.touch.bottom", 12);
+pref("browser.ui.touch.top", 12);
+pref("browser.ui.touch.bottom", 4);
 pref("browser.ui.touch.weight.visited", 120); // percentage
 
 // plugins
 pref("plugin.disable", true);
 pref("plugin.default_plugin_disabled", true);
 
 // product URLs
 // The breakpad report server to link to in about:crashes
--- a/chrome/content/browser.js
+++ b/chrome/content/browser.js
@@ -1955,19 +1955,19 @@ const ElementTouchHelper = {
   },
 
   /* Retrieve the closest element to a point by looking at borders position */
   getClosest: function getClosest(aWindowUtils, aX, aY) {
     let target = aWindowUtils.elementFromPoint(aX, aY,
                                                true,   /* ignore root scroll frame*/
                                                false); /* don't flush layout */
 
-    let nodes = aWindowUtils.nodesFromRect(aX, aY, this.radius.bottom,
+    let nodes = aWindowUtils.nodesFromRect(aX, aY, this.radius.top,
                                                    this.radius.right,
-                                                   this.radius.top,
+                                                   this.radius.bottom,
                                                    this.radius.left, true, false);
 
     // return early if the click is just over a clickable element
     if (this._isElementClickable(target, nodes))
       return target;
 
     let threshold = Number.POSITIVE_INFINITY;
     for (let i = 0; i < nodes.length; i++) {