From 85241a390a0c941f615f2ce47b0d908baa349d0b Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Wed, 1 Jul 2009 01:17:13 -0700 Subject: [PATCH] Bug 501413 - In a right-to-left localization, clicking any url in the bookmark sidebar doesn't work; r=mak77 --- browser/components/places/content/sidebarUtils.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/browser/components/places/content/sidebarUtils.js b/browser/components/places/content/sidebarUtils.js index 0d100508816f..13ac90b2801d 100644 --- a/browser/components/places/content/sidebarUtils.js +++ b/browser/components/places/content/sidebarUtils.js @@ -55,7 +55,16 @@ var SidebarUtils = { var x = { }, y = { }, w = { }, h = { }; tbo.getCoordsForCellItem(row.value, col.value, "image", x, y, w, h); - mouseInGutter = aEvent.clientX < x.value; + // getCoordsForCellItem returns the x coordinate in logical coordinates + // (i.e., starting from the left and right sides in LTR and RTL modes, + // respectively.) Therefore, we make sure to exclude the blank area + // before the tree item icon (that is, to the left or right of it in + // LTR and RTL modes, respectively) from the click target area. + var isRTL = window.getComputedStyle(aTree, null).direction == "rtl"; + if (isRTL) + mouseInGutter = aEvent.clientX > x.value; + else + mouseInGutter = aEvent.clientX < x.value; } #ifdef XP_MACOSX