bug 904555 - clean up use of nsRect APIs in layout. r=roc

This commit is contained in:
Jonathan Kew 2013-08-14 13:27:20 +01:00
parent 7e5943c8be
commit 5ef7fb8ece
7 changed files with 11 additions and 12 deletions

View File

@ -3039,7 +3039,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
// construct the html reflow state for the block. ReflowBlock
// will initialize it
nsHTMLReflowState blockHtmlRS(aState.mPresContext, aState.mReflowState, frame,
nsSize(availSpace.width, availSpace.height));
availSpace.Size());
blockHtmlRS.mFlags.mHasClearance = aLine->HasClearance();
nsFloatManager::SavedState floatManagerState;
@ -5730,7 +5730,7 @@ nsBlockFrame::ComputeFloatWidth(nsBlockReflowState& aState,
aFloat);
nsHTMLReflowState floatRS(aState.mPresContext, aState.mReflowState, aFloat,
nsSize(availSpace.width, availSpace.height));
availSpace.Size());
return floatRS.ComputedWidth() + floatRS.mComputedBorderPadding.LeftRight() +
floatRS.mComputedMargin.LeftRight();
}

View File

@ -7715,7 +7715,7 @@ nsFrame::DoLayout(nsBoxLayoutState& aState)
// ensure our size is what we think is should be. Someone could have
// reset the frame to be smaller or something dumb like that.
SetSize(nsSize(ourRect.width, ourRect.height));
SetSize(ourRect.Size());
}
}

View File

@ -830,8 +830,8 @@ public:
* position.
*/
nsRect GetRect() const { return mRect; }
nsPoint GetPosition() const { return nsPoint(mRect.x, mRect.y); }
nsSize GetSize() const { return nsSize(mRect.width, mRect.height); }
nsPoint GetPosition() const { return mRect.TopLeft(); }
nsSize GetSize() const { return mRect.Size(); }
/**
* When we change the size of the frame's border-box rect, we may need to

View File

@ -1260,8 +1260,7 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset,
// collapse the cell!
nsRect cellBounds(0, 0, cRect.width, cRect.height);
nsOverflowAreas cellOverflow(cellBounds, cellBounds);
cellFrame->FinishAndStoreOverflow(cellOverflow,
nsSize(cRect.width, cRect.height));
cellFrame->FinishAndStoreOverflow(cellOverflow, cRect.Size());
nsTableFrame::RePositionViews(cellFrame);
ConsiderChildOverflow(overflow, cellFrame);
@ -1276,8 +1275,8 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset,
}
SetRect(rowRect);
overflow.UnionAllWith(nsRect(0,0,rowRect.width, rowRect.height));
FinishAndStoreOverflow(overflow, nsSize(rowRect.width, rowRect.height));
overflow.UnionAllWith(nsRect(0, 0, rowRect.width, rowRect.height));
FinishAndStoreOverflow(overflow, rowRect.Size());
nsTableFrame::RePositionViews(this);
nsTableFrame::InvalidateTableFrame(this, oldRect, oldVisualOverflow, false);

View File

@ -837,7 +837,7 @@ nsTableRowGroupFrame::CollapseRowGroupIfNecessary(nscoord aYTotalOffset,
SetRect(groupRect);
overflow.UnionAllWith(nsRect(0, 0, groupRect.width, groupRect.height));
FinishAndStoreOverflow(overflow, nsSize(groupRect.width, groupRect.height));
FinishAndStoreOverflow(overflow, groupRect.Size());
nsTableFrame::RePositionViews(this);
nsTableFrame::InvalidateTableFrame(this, oldGroupRect, oldGroupVisualOverflow,
false);

View File

@ -245,7 +245,7 @@ nsBox::SetBounds(nsBoxLayoutState& aState, const nsRect& aRect, bool aRemoveOver
flags |= stateFlags;
if ((flags & NS_FRAME_NO_MOVE_FRAME) == NS_FRAME_NO_MOVE_FRAME)
SetSize(nsSize(aRect.width, aRect.height));
SetSize(aRect.Size());
else
SetRect(aRect);

View File

@ -496,7 +496,7 @@ nsImageBoxFrame::GetPrefSize(nsBoxLayoutState& aState)
GetImageSize();
if (!mUseSrcAttr && (mSubRect.width > 0 || mSubRect.height > 0))
size = nsSize(mSubRect.width, mSubRect.height);
size = mSubRect.Size();
else
size = mImageSize;