bug 314350, implement GetScrolledSize in nsScrollBoxObject

r/sr=bzbarsky
This commit is contained in:
hwaara%gmail.com 2005-11-06 15:10:09 +00:00
parent 52230a880c
commit 9d82e45dd4

View File

@ -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); */