From 3fc98122e0fdae69dd8f4fd8ebe241b6e14b5713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Thu, 9 Apr 2009 08:42:01 +0200 Subject: [PATCH] Bug 486821 - Misplaced white line under last visible entry of location bar autocomplete. r=enn --- toolkit/content/widgets/autocomplete.xml | 6 ++-- toolkit/content/widgets/richlistbox.xml | 37 +++++++++++++++--------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index a7e5e0822511..cbcf86f8347f 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -1038,11 +1038,11 @@ // Default the height to 0 if we have no rows to show let height = 0; if (numRows) { - let lastRowShown = rows[numRows - 1]; + let firstRowRect = rows[0].getBoundingClientRect(); + let lastRowRect = rows[numRows - 1].getBoundingClientRect(); // Calculate the height to have the first row to last row shown - height = lastRowShown.boxObject.y + lastRowShown.boxObject.height - - rows[0].boxObject.y; + height = lastRowRect.bottom - firstRowRect.top; } // Only update the height if we have a non-zero height and if it diff --git a/toolkit/content/widgets/richlistbox.xml b/toolkit/content/widgets/richlistbox.xml index eedf6e5bbde3..70b73b378c9a 100644 --- a/toolkit/content/widgets/richlistbox.xml +++ b/toolkit/content/widgets/richlistbox.xml @@ -58,12 +58,14 @@ - null + + document.getAnonymousElementByAttribute(this, "anonid", "main-box"); + + + this._scrollbox.boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject); + = 0) { + // scrollRect.bottom wouldn't take a horizontal scroll bar into account + let scrollRectBottom = scrollRect.top + this._scrollbox.clientHeight; + offset = targetRect.bottom - scrollRectBottom; + if (offset <= 0) + return; + } + this._scrollbox.scrollTop += offset; ]]> @@ -461,7 +474,7 @@