if (oldSize.width != aDesiredSize.width || oldSize.height != aDesiredSize.height) {
if (currentSize.width != aDesiredSize.width || currentSize.height != aDesiredSize.height) {
nsGfxScrollFrameInner::ReflowFrame(    nsIPresContext*          aPresContext,                               nsHTMLReflowMetrics&     aDesiredSize,                               const nsHTMLReflowState& aReflowState,                               nsReflowStatus&          aStatus,                               nsIFrame*                aFrame,                               const nsSize&            aAvailable,                               const nsSize&            aComputed,                               PRBool&                  aResized,                               nsIFrame*&               aIncrementalChild){    // get the current size    nsSize oldSize;    GetFrameSize(aFrame, oldSize);    aDesiredSize.width = 0;    aDesiredSize.height = 0;    nsHTMLReflowState childReflowState(aPresContext, aReflowState,                                           aFrame, aAvailable);    // handle incremental reflow    if (aReflowState.reason == eReflowReason_Incremental) {        if (aFrame == aIncrementalChild)           aIncrementalChild = nsnull;        else            childReflowState.reason = eReflowReason_Resize;    }    childReflowState.mComputedWidth =  aComputed.width;    childReflowState.mComputedHeight = aComputed.height;    // subtract out the childs margin and border if computed    const nsStyleSpacing* spacing;    nsresult rv = aFrame->GetStyleData(eStyleStruct_Spacing,                   (const nsStyleStruct*&) spacing);    NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get spacing");    if (NS_FAILED(rv))        return rv;    // this basically sucks. Sometime it fails to get the border and padding    // because one or the other is not set. So we are forced to go out and get    // the border and padding separately and add them together.    /*    nsMargin border;    if (!spacing->GetBorderPadding(border)) {      if (!spacing->GetBorder(border))         border.SizeTo(0,0,0,0);            border += padding;    }    */    nsMargin margin(0,0,0,0);    spacing->GetMargin(margin);    /*   if (aFrame == mScrollAreaFrame) {       childReflowState.mComputedBorderPadding -= childReflowState.mComputedPadding;       childReflowState.mComputedPadding = nsMargin(0,0,0,0);   }    if (childReflowState.mComputedWidth != NS_INTRINSICSIZE)       childReflowState.mComputedWidth -= childReflowState.mComputedBorderPadding.left + childReflowState.mComputedBorderPadding.right;    if (childReflowState.mComputedHeight != NS_INTRINSICSIZE)       childReflowState.mComputedHeight -= childReflowState.mComputedBorderPadding.top + childReflowState.mComputedBorderPadding.bottom;    */         mOuter->ReflowChild(aFrame, aPresContext, aDesiredSize, childReflowState,                        0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);    NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");    // if the frame size change then mark the flag    if (oldSize.width != aDesiredSize.width || oldSize.height != aDesiredSize.height) {       aFrame->SizeTo(aPresContext, aDesiredSize.width, aDesiredSize.height);       aResized = PR_TRUE;    }    aFrame->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);    // add the margin back in    aDesiredSize.width += margin.left + margin.right;    aDesiredSize.height += margin.top + margin.bottom;    return NS_OK;}