PRInt32     numkids, cnt;
static void calc_extents(nsIView *view, nsRect *extents, nscoord ox, nscoord oy){  nsIView     *kid;  PRInt32     numkids, cnt;  nsRect      bounds;  nsIClipView *cview;  view->GetChildCount(numkids);  for (cnt = 0; cnt < numkids; cnt++)  {    view->GetChild(cnt, kid);    kid->GetBounds(bounds);    bounds.x += ox;    bounds.y += oy;    extents->UnionRect(*extents, bounds);    cview = nsnull;    kid->QueryInterface(NS_GET_IID(nsIClipView), (void **)&cview);    if (!cview)      calc_extents(kid, extents, bounds.x, bounds.y);  }}