nsCalculatedBoxInfoImpl aSize;
nsCalculatedBoxInfoImpl aSize(childFrame);
nsBoxDebugInner::DisplayDebugInfoFor(nsIPresContext* aPresContext,                                     nsPoint&        aPoint,                                     PRInt32&        aCursor){    nscoord x = aPoint.x;    nscoord y = aPoint.y;    // get it into our coordintate system by subtracting our parents offsets.    nsIFrame* parent = mOuter;    while(parent != nsnull)    {      // if we hit a scrollable view make sure we take into account      // how much we are scrolled.      nsIScrollableView* scrollingView;      nsIView*           view;      parent->GetView(aPresContext, &view);      if (view) {        nsresult result = view->QueryInterface(kScrollViewIID, (void**)&scrollingView);        if (NS_SUCCEEDED(result)) {            nscoord xoff = 0;            nscoord yoff = 0;            scrollingView->GetScrollPosition(xoff, yoff);            x += xoff;            y += yoff;                 }      }     nsRect cr;     parent->GetRect(cr);     x -= cr.x;     y -= cr.y;     parent->GetParent(&parent);    }    nsRect r(0,0,mOuter->mRect.width, mOuter->mRect.height);    PRBool isHorizontal = mOuter->mInner->mHorizontal;    if (!r.Contains(nsPoint(x,y)))        return NS_OK;        int count = 0;        nsIFrame* childFrame = mOuter->mFrames.FirstChild();         nsCalculatedBoxInfo* info = mOuter->mInner->mInfoList->GetFirst();        while (nsnull != childFrame)         {                childFrame->GetRect(r);            // if we are not in the child. But in the spring above the child.            if (((isHorizontal && x >= r.x && x < r.x + r.width && y < r.y) ||                (!isHorizontal && y >= r.y && y < r.y + r.height && x < r.x))) {                //printf("y=%d, r.y=%d\n",y,r.y);                aCursor = NS_STYLE_CURSOR_POINTER;                   // found it but we already showed it.                    if (mDebugChild == childFrame)                        return NS_OK;                    nsCOMPtr<nsIContent> content;                    mOuter->mInner->GetContentOf(childFrame, getter_AddRefs(content));                    nsString id;                    content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::id, id);                    char idValue[100];                    id.ToCString(idValue,100);                                           nsString kClass;                    content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::kClass, kClass);                    char kClassValue[100];                    kClass.ToCString(kClassValue,100);                    nsCOMPtr<nsIAtom> tag;                    content->GetTag(*getter_AddRefs(tag));                    nsString tagString;                    tag->ToString(tagString);                    char tagValue[100];                    tagString.ToCString(tagValue,100);                    printf("--------------------\n");                    printf("Tag='%s', id='%s' class='%s'\n", tagValue, idValue, kClassValue);                    mDebugChild = childFrame;                    nsCalculatedBoxInfoImpl aSize;                    aSize.prefSize.width = NS_INTRINSICSIZE;                    aSize.prefSize.height = NS_INTRINSICSIZE;                    aSize.minSize.width = NS_INTRINSICSIZE;                    aSize.minSize.height = NS_INTRINSICSIZE;                    aSize.maxSize.width = NS_INTRINSICSIZE;                    aSize.maxSize.height = NS_INTRINSICSIZE;                    aSize.calculatedSize.width = NS_INTRINSICSIZE;                    aSize.calculatedSize.height = NS_INTRINSICSIZE;                    aSize.flex = -1.0;                  // add in the css min, max, pref                    const nsStylePosition* position;                    nsresult rv = childFrame->GetStyleData(eStyleStruct_Position,                                  (const nsStyleStruct*&) position);                    NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get position");                    if (NS_FAILED(rv))                        return rv;                    // see if the width or height was specifically set                    if (position->mWidth.GetUnit() == eStyleUnit_Coord)  {                        aSize.prefSize.width = position->mWidth.GetCoordValue();                    }                    if (position->mHeight.GetUnit() == eStyleUnit_Coord) {                        aSize.prefSize.height = position->mHeight.GetCoordValue();                         }                        // same for min size. Unfortunately min size is always set to 0. So for now                    // we will assume 0 means not set.                    if (position->mMinWidth.GetUnit() == eStyleUnit_Coord) {                        nscoord min = position->mMinWidth.GetCoordValue();                        if (min != 0)                           aSize.minSize.width = min;                    }                    if (position->mMinHeight.GetUnit() == eStyleUnit_Coord) {                        nscoord min = position->mMinHeight.GetCoordValue();                        if (min != 0)                           aSize.minSize.height = min;                    }                    // and max                    if (position->mMaxWidth.GetUnit() == eStyleUnit_Coord) {                        nscoord max = position->mMaxWidth.GetCoordValue();                        aSize.maxSize.width = max;                    }                    if (position->mMaxHeight.GetUnit() == eStyleUnit_Coord) {                        nscoord max = position->mMaxHeight.GetCoordValue();                        aSize.maxSize.height = max;                    }                    PRInt32 error;                    nsAutoString value;                    if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::flex, value))                    {                        value.Trim("%");                        aSize.flex = value.ToFloat(&error);                    }                    if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::width, value))                    {                        float p2t;                        aPresContext->GetScaledPixelsToTwips(&p2t);                        value.Trim("%");                        aSize.prefSize.width = NSIntPixelsToTwips(value.ToInteger(&error), p2t);                    }                    if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::height, value))                    {                        float p2t;                        aPresContext->GetScaledPixelsToTwips(&p2t);                        value.Trim("%");                        aSize.prefSize.height = NSIntPixelsToTwips(value.ToInteger(&error), p2t);                    }                               char min[100];                    char pref[100];                    char max[100];                    char calc[100];                    char flex[100];                    GetValue(info->minSize,  aSize.minSize, min);                    GetValue(info->prefSize, aSize.prefSize, pref);                    GetValue(info->maxSize, aSize.maxSize, max);                    GetValue(info->calculatedSize,  aSize.calculatedSize, calc);                    GetValue(info->flex,  aSize.flex, flex);                    printf("min%s, pref%s, max%s, actual%s, flex=%s\n",                         min,                        pref,                        max,                        calc,                        flex                    );                break;               }          nsresult rv = childFrame->GetNextSibling(&childFrame);          NS_ASSERTION(rv == NS_OK,"failed to get next child");          if (NS_FAILED(rv))              return rv;          info = info->next;          count++;        }        return NS_OK;}