context->GetPixelsToTwips(&pixelsToTwips);
pixelsToTwips = context->PixelsToTwips();
NS_IMETHODIMP nsScrollBoxObject::ScrollToElement(nsIDOMElement *child){    nsIScrollableView* scrollableView = GetScrollableView();    if (!scrollableView)       return NS_ERROR_FAILURE;    // prepare for twips    nsCOMPtr<nsIPresContext> context;    mPresShell->GetPresContext(getter_AddRefs(context));    float pixelsToTwips = 0.0;    context->GetPixelsToTwips(&pixelsToTwips);        // get our box    nsIFrame* frame = GetFrame();    nsIBox *box;    CallQueryInterface(frame, &box);    nsRect rect, crect;    nsIBox* scrolledBox;    nsCOMPtr<nsIDOMXULElement> childDOMXULElement (do_QueryInterface(child));    nsIBoxObject * childBoxObject;	childDOMXULElement->GetBoxObject(&childBoxObject);    PRInt32 x,y;    childBoxObject->GetX(&x);    childBoxObject->GetY(&y);    // get the twips rectangle from the boxobject (which has pixels)        rect.x = NSToIntRound(x * pixelsToTwips);    rect.y = NSToIntRound(y * pixelsToTwips);        // get the scrolled box    box->GetChildBox(&scrolledBox);    // TODO: make sure the child is inside the box    // get our current info    PRBool horiz = PR_FALSE;    scrolledBox->GetOrientation(horiz);    nsPoint cp;    scrollableView->GetScrollPosition(cp.x,cp.y);    GetOffsetRect(crect);        crect.x = NSToIntRound(crect.x * pixelsToTwips);    crect.y = NSToIntRound(crect.y * pixelsToTwips);    nscoord newx=cp.x, newy=cp.y;    // we only scroll in the direction of the scrollbox orientation    // always scroll to left or top edge of child element    if (horiz) {        newx = rect.x - crect.x;    } else {        newy = rect.y - crect.y;    }    // scroll away    return scrollableView->ScrollTo(newx, newy, NS_SCROLL_PROPERTY_ALWAYS_BLIT);}