printf("-------box info---------\n"); nsFrame::ListTag(stdout, childFrame); printf("\n");
nsCOMPtr<nsIContent> content; childFrame->GetContent(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);
nsBoxDebugInner::MouseMove(nsIDOMEvent* aMouseEvent){          nsCOMPtr<nsIDOMUIEvent> uiEvent(do_QueryInterface(aMouseEvent));          PRInt32 xPx = 0;          PRInt32 yPx = 0;          uiEvent->GetClientX(&xPx);          uiEvent->GetClientY(&yPx);                         nscoord onePixel = NSIntPixelsToTwips(1, mP2t);           nscoord x = xPx*onePixel;           nscoord y = yPx*onePixel;           // 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(&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 r;             parent->GetRect(r);             x -= r.x;             y -= r.y;             parent->GetParent(&parent);           }        int count = 0;        nsIFrame* childFrame = mOuter->mFrames.FirstChild();         while (nsnull != childFrame)         {                nsRect r(0,0,0,0);            childFrame->GetRect(r);            // if we are not in the child. But in the spring above the child.            if (!r.Contains(x,y) && ((mOuter->mHorizontal && x >= r.x && x < r.x + r.width) ||                (!mOuter->mHorizontal && y >= r.y && y < r.y + r.height))) {                    // found it but we already showed it.                    if (mDebugChild == childFrame)                        return NS_OK;                    printf("-------box info---------\n");                    nsFrame::ListTag(stdout, childFrame);                    printf("\n");                    mDebugChild = childFrame;                    nsCalculatedBoxInfo 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);                    // 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;                    }                    // get the flexibility                    nsCOMPtr<nsIContent> content;                    childFrame->GetContent(getter_AddRefs(content));                    PRInt32 error;                    nsAutoString value;                    if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsXULAtoms::flex, value))                    {                        value.Trim("%");                        // convert to a percent.                        aSize.flex = value.ToFloat(&error)/float(100.0);                    }                    if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::width, value))                    {                        nsHTMLValue aResult;                        nsGenericHTMLElement::ParseValueOrPercent(value, aResult, eHTMLUnit_Pixel);                        aSize.prefSize.width = NSIntPixelsToTwips(aResult.GetPixelValue(), mP2t);                    }                    if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttribute(kNameSpaceID_None, nsHTMLAtoms::height, value))                    {                        nsHTMLValue aResult;                        nsGenericHTMLElement::ParseValueOrPercent(value, aResult, eHTMLUnit_Pixel);                        aSize.prefSize.height = NSIntPixelsToTwips(aResult.GetPixelValue(), mP2t);                    }                    char min[100];                    char pref[100];                    char max[100];                    char calc[100];                    char flex[100];                    GetValue(mOuter->mSprings[count].minSize,  aSize.minSize, min);                    GetValue(mOuter->mSprings[count].prefSize, aSize.prefSize, pref);                    GetValue(mOuter->mSprings[count].maxSize, aSize.maxSize, max);                    GetValue(mOuter->mSprings[count].calculatedSize,  aSize.calculatedSize, calc);                    GetValue(mOuter->mSprings[count].flex,  aSize.flex, flex);                    printf("min%s, pref%s, max%s, actual%s, flex=%s\n",                         min,                        pref,                        max,                        calc,                        flex                    );                    return NS_OK;                }                    nsresult rv = childFrame->GetNextSibling(&childFrame);          NS_ASSERTION(rv == NS_OK,"failed to get next child");          count++;        }       // mDebugChild = nsnull;        return NS_OK;}