printf("---------------\n");
PRINTF("---------------\n");
nsBoxFrameInner::DisplayDebugInfoFor(nsIBox* aBox,                                     nsIPresContext* aPresContext,                                     nsPoint&        aPoint,                                     PRInt32&        aCursor){    nsBoxLayoutState state(aPresContext);    nscoord x = aPoint.x;    nscoord y = aPoint.y;    nsIFrame* ourFrame = nsnull;    aBox->GetFrame(&ourFrame);    // get the area inside our border but not our debug margins.    nsRect insideBorder;    aBox->GetContentRect(insideBorder);    nsMargin border(0,0,0,0);    aBox->GetBorderAndPadding(border);    insideBorder.Deflate(border);    PRBool isHorizontal = mOuter->IsHorizontal();    if (!insideBorder.Contains(nsPoint(x,y)))        return NS_ERROR_FAILURE;        //printf("%%%%%% inside box %%%%%%%\n");        int count = 0;        nsIBox* child = nsnull;        aBox->GetChildBox(&child);        nsMargin m;        nsMargin m2;        GetDebugBorder(m);        PixelMarginToTwips(aPresContext, m);        GetDebugMargin(m2);        PixelMarginToTwips(aPresContext, m2);        m += m2;        if ((isHorizontal && y < insideBorder.y + m.top) ||            (!isHorizontal && x < insideBorder.x + m.left)) {            //printf("**** inside debug border *******\n");            while (child)             {                   nsRect r;               child->GetBounds(r);               nsIFrame* childFrame = nsnull;               child->GetFrame(&childFrame);                // if we are not in the child. But in the spring above the child.                if ((isHorizontal && x >= r.x && x < r.x + r.width) ||                    (!isHorizontal && y >= r.y && y < r.y + r.height)) {                    aCursor = NS_STYLE_CURSOR_POINTER;                       // found it but we already showed it.                        if (mDebugChild == child)                            return NS_OK;                            nsCOMPtr<nsIContent> content;                            ourFrame->GetContent(getter_AddRefs(content));                            if (content) {                                                           printf("---------------\n");                              mOuter->DumpBox(stdout);                              printf("\n");                            }                        childFrame->GetContent(getter_AddRefs(content));                        if (content) {                            printf("child #%d: ", count);                            child->DumpBox(stdout);                            printf("\n");                        }                        mDebugChild = child;                        nsSize prefSizeCSS(NS_INTRINSICSIZE, NS_INTRINSICSIZE);                        nsSize minSizeCSS (NS_INTRINSICSIZE, NS_INTRINSICSIZE);                        nsSize maxSizeCSS (NS_INTRINSICSIZE, NS_INTRINSICSIZE);                        nscoord flexCSS = NS_INTRINSICSIZE;                        nsSize prefSize(0, 0);                        nsSize minSize (0, 0);                        nsSize maxSize (NS_INTRINSICSIZE, NS_INTRINSICSIZE);                        nscoord flexSize = 0;                        nsIBox::AddCSSPrefSize(state, child, prefSizeCSS);                        nsIBox::AddCSSMinSize (state, child, minSizeCSS);                        nsIBox::AddCSSMaxSize (state, child, maxSizeCSS);                        nsIBox::AddCSSFlex    (state, child, flexCSS);                        child->GetPrefSize(state, prefSize);                        child->GetMinSize(state, minSize);                        child->GetMaxSize(state, maxSize);                        child->GetFlex(state, flexSize);                        char min[100];                        char pref[100];                        char max[100];                        char calc[100];                        char flex[100];                                              nsSize actualSize;                        GetFrameSizeWithMargin(child, actualSize);                        nsSize actualSizeCSS (NS_INTRINSICSIZE, NS_INTRINSICSIZE);                        GetValue(aPresContext, minSize,  minSizeCSS, min);                        GetValue(aPresContext, prefSize, prefSizeCSS, pref);                        GetValue(aPresContext, maxSize,  maxSizeCSS, max);                        GetValue(aPresContext, actualSize, actualSizeCSS, calc);                        GetValue(aPresContext, flexSize,  flexCSS, flex);                        printf("min%s, pref%s, max%s, actual%s, flex=%s\n\n",                             min,                            pref,                            max,                            calc,                            flex                        );                        return NS_OK;                   }              child->GetNextBox(&child);              count++;            }        } else {        }        mDebugChild = nsnull;        return NS_OK;}