diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 9ca88b983b58..7c9964c09345 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -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(); } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 199678c1d7ad..4b0c016d6795 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -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()); } } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 06241eda8860..494424d0b51c 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -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 diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index c1e6dba25c70..f95da67a702a 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -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); diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index c984782e34a9..111568584895 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -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); diff --git a/layout/xul/base/src/nsBox.cpp b/layout/xul/base/src/nsBox.cpp index 84e03f8f54f7..ada6abe677d2 100644 --- a/layout/xul/base/src/nsBox.cpp +++ b/layout/xul/base/src/nsBox.cpp @@ -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); diff --git a/layout/xul/base/src/nsImageBoxFrame.cpp b/layout/xul/base/src/nsImageBoxFrame.cpp index e0147855e737..ac4e82f3306c 100644 --- a/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/layout/xul/base/src/nsImageBoxFrame.cpp @@ -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;