nsRect borderRect(inner);
nsBoxFrameInner::PaintDebug(nsIBox* aBox,                         nsIPresContext* aPresContext,                        nsIRenderingContext& aRenderingContext,                        const nsRect& aDirtyRect,                        nsFramePaintLayer aWhichLayer){            PRBool isHorizontal = mOuter->IsHorizontal();        float p2t;        aPresContext->GetScaledPixelsToTwips(&p2t);        nscoord onePixel = NSIntPixelsToTwips(1, p2t);        nsMargin debugBorder(0,0,0,0);        nsMargin debugMargin(0,0,0,0);        nsMargin debugPadding(0,0,0,0);        GetDebugBorder(debugBorder);        PixelMarginToTwips(aPresContext, debugBorder);        GetDebugMargin(debugMargin);        PixelMarginToTwips(aPresContext, debugMargin);        GetDebugPadding(debugPadding);        PixelMarginToTwips(aPresContext, debugPadding);        nsRect inner(0,0,0,0);        aBox->GetContentRect(inner);        inner.Deflate(debugMargin);        nsRect borderRect(inner);        nscolor color;        if (isHorizontal) {          color = NS_RGB(0,0,255);        } else {          color = NS_RGB(255,0,0);        }                //left        aRenderingContext.SetColor(color);        nsRect r(inner);        r.width = debugBorder.left;        aRenderingContext.FillRect(r);        // top        r = inner;        r.height = debugBorder.top;        aRenderingContext.FillRect(r);        //right        r = inner;        r.x = r.x + r.width - debugBorder.right;        r.width = debugBorder.right;        aRenderingContext.FillRect(r);        //bottom        r = inner;        r.y = r.y + r.height - debugBorder.bottom;        r.height = debugBorder.bottom;        aRenderingContext.FillRect(r);        // paint the springs.        nscoord x, y, borderSize, springSize;                aRenderingContext.SetColor(NS_RGB(255,255,255));                if (isHorizontal)         {            x = inner.x;            y = inner.y + onePixel;            x += debugBorder.left;            springSize = debugBorder.top - onePixel*4;        } else {            x = inner.y;            y = inner.x + onePixel;            x += debugBorder.top;            springSize = debugBorder.left - onePixel*4;        }        nsIBox* box = nsnull;        aBox->GetChildBox(&box);        nsBoxLayoutState state(aPresContext);        while (box) {          nsSize size;          GetFrameSizeWithMargin(box, size);          PRBool isCollapsed = PR_FALSE;          box->IsCollapsed(state, isCollapsed);          if (!isCollapsed) {                if (isHorizontal)                     borderSize = size.width;                else                     borderSize = size.height;                /*                if (mDebugChild == info->frame)                 {                    aRenderingContext.SetColor(NS_RGB(0,255,0));                    if (mOuter->mInner->mHorizontal)                         aRenderingContext.FillRect(x, inner.y, size.width, debugBorder.top);                    else                        aRenderingContext.FillRect(inner.x, x, size.height, debugBorder.left);                    aRenderingContext.SetColor(debugColor->mColor);                }                */                nscoord flex = 0;                box->GetFlex(state, flex);                DrawSpring(aPresContext, aRenderingContext, isHorizontal, flex, x, y, borderSize, springSize);                x += borderSize;            }            box->GetNextBox(&box);        }        return NS_OK;}