diff --git a/layout/xul/base/src/nsScrollBoxObject.cpp b/layout/xul/base/src/nsScrollBoxObject.cpp index 2e853692afaa..9eba04fc4fa9 100644 --- a/layout/xul/base/src/nsScrollBoxObject.cpp +++ b/layout/xul/base/src/nsScrollBoxObject.cpp @@ -318,7 +318,17 @@ NS_IMETHODIMP nsScrollBoxObject::GetPosition(PRInt32 *x, PRInt32 *y) /* void getScrolledSize (out long width, out long height); */ NS_IMETHODIMP nsScrollBoxObject::GetScrolledSize(PRInt32 *width, PRInt32 *height) { - return NS_ERROR_NOT_IMPLEMENTED; + nsIFrame* scrolledBox = GetScrolledBox(this); + if (!scrolledBox) + return NS_ERROR_FAILURE; + + nsRect scrollRect = scrolledBox->GetRect(); + float twipsToPixels = mPresShell->GetPresContext()->TwipsToPixels(); + + *width = NSTwipsToIntPixels(scrollRect.width, twipsToPixels); + *height = NSTwipsToIntPixels(scrollRect.height, twipsToPixels); + + return NS_OK; } /* void ensureElementIsVisible (in nsIDOMElement child); */