Bug 1309467 Part 3 - Move FloatInfo::mRect construction into FloatInfo's constructor. r=dbaron

In later parts, we need the aMarginRect to build rect for shape box.

MozReview-Commit-ID: LtwMxbsNu3u

--HG--
extra : rebase_source : eee35663458079026b14922499b566674b2680ac
This commit is contained in:
Ting-Yu Lin 2016-10-12 14:26:26 +08:00
parent 91e0aadf9e
commit f55545b058
2 changed files with 13 additions and 10 deletions

View File

@ -261,11 +261,8 @@ nsFloatManager::AddFloat(nsIFrame* aFloatFrame, const LogicalRect& aMarginRect,
NS_ASSERTION(aMarginRect.ISize(aWM) >= 0, "negative inline size!");
NS_ASSERTION(aMarginRect.BSize(aWM) >= 0, "negative block size!");
FloatInfo info(aFloatFrame,
aMarginRect.LineLeft(aWM, aContainerSize) + mLineLeft,
aMarginRect.BStart(aWM) + mBlockStart,
aMarginRect.ISize(aWM),
aMarginRect.BSize(aWM));
FloatInfo info(aFloatFrame, mLineLeft, mBlockStart, aMarginRect, aWM,
aContainerSize);
// Set mLeftBEnd and mRightBEnd.
if (HasAnyFloats()) {
@ -529,10 +526,15 @@ nsFloatManager::ClearContinues(StyleClear aBreakType) const
// FloatInfo
nsFloatManager::FloatInfo::FloatInfo(nsIFrame* aFrame,
nscoord aLineLeft, nscoord aBStart,
nscoord aISize, nscoord aBSize)
nscoord aLineLeft, nscoord aBlockStart,
const LogicalRect& aMarginRect,
WritingMode aWM,
const nsSize& aContainerSize)
: mFrame(aFrame)
, mRect(aLineLeft, aBStart, aISize, aBSize)
, mRect(aMarginRect.LineLeft(aWM, aContainerSize) + aLineLeft,
aMarginRect.BStart(aWM) + aBlockStart,
aMarginRect.ISize(aWM),
aMarginRect.BSize(aWM))
{
MOZ_COUNT_CTOR(nsFloatManager::FloatInfo);
}

View File

@ -312,8 +312,9 @@ private:
// this one.
nscoord mLeftBEnd, mRightBEnd;
FloatInfo(nsIFrame* aFrame, nscoord aLineLeft, nscoord aBStart,
nscoord aISize, nscoord aBSize);
FloatInfo(nsIFrame* aFrame, nscoord aLineLeft, nscoord aBlockStart,
const mozilla::LogicalRect& aMarginRect,
mozilla::WritingMode aWM, const nsSize& aContainerSize);
nscoord LineLeft() const { return mRect.x; }
nscoord LineRight() const { return mRect.XMost(); }