Bug 1277129 Part 6b - Rename rendContext to mRenderingContext in SizeComputationInput. r=dbaron

MozReview-Commit-ID: LczLJDtDncy

--HG--
extra : rebase_source : c32e928ae25f94305fb907db89278dce7304a903
This commit is contained in:
Ting-Yu Lin 2016-07-21 18:36:38 +08:00
Родитель cd13f0ea71
Коммит 55cde36029
26 изменённых файлов: 42 добавлений и 42 удалений

Просмотреть файл

@ -870,7 +870,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
NS_ASSERTION(scrollable, "List must be a scrollable frame");
buttonISize = scrollable->GetNondisappearingScrollbarWidth(
PresContext(), aReflowState.rendContext, wm);
PresContext(), aReflowState.mRenderingContext, wm);
if (buttonISize > aReflowState.ComputedISize()) {
buttonISize = 0;
}

Просмотреть файл

@ -429,13 +429,13 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
innerAvailSize.BSize(innerWM) = legendAvailSize.BSize(legendWM) =
NS_UNCONSTRAINEDSIZE;
NS_ASSERTION(!inner ||
nsLayoutUtils::IntrinsicForContainer(aReflowState.rendContext,
nsLayoutUtils::IntrinsicForContainer(aReflowState.mRenderingContext,
inner,
nsLayoutUtils::MIN_ISIZE) <=
innerAvailSize.ISize(innerWM),
"Bogus availSize.ISize; should be bigger");
NS_ASSERTION(!legend ||
nsLayoutUtils::IntrinsicForContainer(aReflowState.rendContext,
nsLayoutUtils::IntrinsicForContainer(aReflowState.mRenderingContext,
legend,
nsLayoutUtils::MIN_ISIZE) <=
legendAvailSize.ISize(legendWM),

Просмотреть файл

@ -286,7 +286,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext,
// focuspadding (which other browsers don't have) so that there's a
// little more space for it.
// Note that GetMinISize includes the focusPadding.
nscoord IOverflow = GetMinISize(aButtonReflowState.rendContext) -
nscoord IOverflow = GetMinISize(aButtonReflowState.mRenderingContext) -
aButtonReflowState.ComputedISize();
nscoord IFocusPadding = focusPadding.IStartEnd(wm);
nscoord focusPaddingReduction = std::min(IFocusPadding,

Просмотреть файл

@ -181,7 +181,7 @@ BlockReflowInput::ComputeReplacedBlockOffsetsForFloats(
iEndOffset = 0;
} else {
LogicalMargin frameMargin(wm);
SizeComputationInput os(aFrame, mReflowState.rendContext,
SizeComputationInput os(aFrame, mReflowState.mRenderingContext,
wm, mContentArea.ISize(wm));
frameMargin =
os.ComputedLogicalMargin().ConvertTo(wm, aFrame->GetWritingMode());
@ -237,7 +237,7 @@ BlockReflowInput::ComputeBlockAvailSpace(nsIFrame* aFrame,
aResult.BSize(wm) = GetFlag(BRS_UNCONSTRAINEDBSIZE)
? NS_UNCONSTRAINEDSIZE
: mReflowState.AvailableBSize() - mBCoord
- GetBEndMarginClone(aFrame, mReflowState.rendContext, mContentArea, wm);
- GetBEndMarginClone(aFrame, mReflowState.mRenderingContext, mContentArea, wm);
// mBCoord might be greater than mBEndEdge if the block's top margin pushes
// it off the page/column. Negative available height can confuse other code
// and is nonsense in principle.
@ -686,7 +686,7 @@ FloatMarginISize(const ReflowInput& aCBReflowState,
LogicalSize floatSize =
aFloat->ComputeSize(
aCBReflowState.rendContext,
aCBReflowState.mRenderingContext,
wm,
aCBReflowState.ComputedSize(wm),
aFloatAvailableISize,
@ -746,7 +746,7 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
NS_ASSERTION(aFloat->GetParent() == mBlock,
"Float frame has wrong parent");
SizeComputationInput offsets(aFloat, mReflowState.rendContext,
SizeComputationInput offsets(aFloat, mReflowState.mRenderingContext,
wm, mReflowState.ComputedISize());
nscoord floatMarginISize = FloatMarginISize(mReflowState,

Просмотреть файл

@ -155,7 +155,7 @@ SizeComputationInput::SizeComputationInput(nsIFrame *aFrame,
WritingMode aContainingBlockWritingMode,
nscoord aContainingBlockISize)
: mFrame(aFrame)
, rendContext(aRenderingContext)
, mRenderingContext(aRenderingContext)
, mWritingMode(aFrame->GetWritingMode())
{
MOZ_ASSERT(!aFrame->IsFlexOrGridItem(),
@ -180,7 +180,7 @@ ReflowInput::ReflowInput(
const LogicalSize& aAvailableSpace,
const LogicalSize* aContainingBlockSize,
uint32_t aFlags)
: SizeComputationInput(aFrame, aParentReflowState.rendContext)
: SizeComputationInput(aFrame, aParentReflowState.mRenderingContext)
, mBlockDelta(0)
, mOrthogonalLimit(NS_UNCONSTRAINEDSIZE)
, mReflowDepth(aParentReflowState.mReflowDepth + 1)
@ -256,7 +256,7 @@ SizeComputationInput::ComputeISizeValue(nscoord aContainingBlockISize,
nscoord aBoxSizingToMarginEdge,
const nsStyleCoord& aCoord) const
{
return nsLayoutUtils::ComputeISizeValue(rendContext, mFrame,
return nsLayoutUtils::ComputeISizeValue(mRenderingContext, mFrame,
aContainingBlockISize,
aContentEdgeToBoxSizing,
aBoxSizingToMarginEdge,
@ -1623,7 +1623,7 @@ ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext,
AutoMaybeDisableFontInflation an(mFrame);
computedSize =
mFrame->ComputeSize(rendContext, wm, cbSize.ConvertTo(wm, cbwm),
mFrame->ComputeSize(mRenderingContext, wm, cbSize.ConvertTo(wm, cbwm),
cbSize.ConvertTo(wm, cbwm).ISize(wm), // XXX or AvailableISize()?
ComputedLogicalMargin().Size(wm) +
ComputedLogicalOffsets().Size(wm),
@ -2366,7 +2366,7 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext,
}
LogicalSize size =
mFrame->ComputeSize(rendContext, wm, cbSize, AvailableISize(),
mFrame->ComputeSize(mRenderingContext, wm, cbSize, AvailableISize(),
ComputedLogicalMargin().Size(wm),
ComputedLogicalBorderPadding().Size(wm) -
ComputedLogicalPadding().Size(wm),

Просмотреть файл

@ -106,8 +106,8 @@ public:
// The frame being reflowed.
nsIFrame* mFrame;
// rendering context to use for measurement
nsRenderingContext* rendContext;
// Rendering context to use for measurement.
nsRenderingContext* mRenderingContext;
const nsMargin& ComputedPhysicalMargin() const { return mComputedMargin; }
const nsMargin& ComputedPhysicalBorderPadding() const { return mComputedBorderPadding; }
@ -166,7 +166,7 @@ public:
// Callers using this constructor must call InitOffsets on their own.
SizeComputationInput(nsIFrame *aFrame, nsRenderingContext *aRenderingContext)
: mFrame(aFrame)
, rendContext(aRenderingContext)
, mRenderingContext(aRenderingContext)
, mWritingMode(aFrame->GetWritingMode())
{
}

Просмотреть файл

@ -984,7 +984,7 @@ CalculateContainingBlockSizeForAbsolutes(WritingMode aWM,
if (scrollFrame) {
scrollbars =
scrollFrame->GetDesiredScrollbarSizes(aLastRS->mFrame->PresContext(),
aLastRS->rendContext);
aLastRS->mRenderingContext);
if (!lastButOneRS->mFlags.mAssumingHScrollbar) {
scrollbars.top = scrollbars.bottom = 0;
}
@ -7399,7 +7399,7 @@ nsBlockFrame::ISizeToClearPastFloats(const BlockReflowInput& aState,
{
nscoord inlineStartOffset, inlineEndOffset;
WritingMode wm = aState.mReflowState.GetWritingMode();
SizeComputationInput offsetState(aFrame, aState.mReflowState.rendContext,
SizeComputationInput offsetState(aFrame, aState.mReflowState.mRenderingContext,
wm, aState.mContentArea.ISize(wm));
ReplacedElementISizeToClear result;

Просмотреть файл

@ -642,7 +642,7 @@ nsBulletFrame::Reflow(nsPresContext* aPresContext,
SetFontSizeInflation(inflation);
// Get the base size
GetDesiredSize(aPresContext, aReflowState.rendContext, aMetrics, inflation,
GetDesiredSize(aPresContext, aReflowState.mRenderingContext, aMetrics, inflation,
&mPadding);
// Add in the border and padding; split the top/bottom between the

Просмотреть файл

@ -1568,7 +1568,7 @@ nsFlexContainerFrame::
if (aAxisTracker.IsMainAxisHorizontal()) {
if (minSizeNeedsToMeasureContent) {
nscoord frameMinISize =
aFlexItem.Frame()->GetMinISize(aItemReflowState.rendContext);
aFlexItem.Frame()->GetMinISize(aItemReflowState.mRenderingContext);
resolvedMinSize = std::min(resolvedMinSize, frameMinISize);
}
NS_ASSERTION(!flexBasisNeedsToMeasureContent,

Просмотреть файл

@ -231,7 +231,7 @@ struct MOZ_STACK_CLASS ScrollReflowInput {
mReflowState(aState),
// mBoxState is just used for scrollbars so we don't need to
// worry about the reflow depth here
mBoxState(aState.mFrame->PresContext(), aState.rendContext, 0),
mBoxState(aState.mFrame->PresContext(), aState.mRenderingContext, 0),
mStyles(aFrame->GetScrollbarStyles()) {
}
};

Просмотреть файл

@ -1672,7 +1672,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowState
{
GridReflowState(nsGridContainerFrame* aFrame,
const ReflowInput& aRS)
: GridReflowState(aFrame, *aRS.rendContext, &aRS, aRS.mStylePosition,
: GridReflowState(aFrame, *aRS.mRenderingContext, &aRS, aRS.mStylePosition,
aRS.GetWritingMode())
{}
GridReflowState(nsGridContainerFrame* aFrame,

Просмотреть файл

@ -944,7 +944,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
} else {
static_cast<nsTextFrame*>(aFrame)->
ReflowText(*this, availableSpaceOnLine,
psd->mReflowState->rendContext->GetDrawTarget(),
psd->mReflowState->mRenderingContext->GetDrawTarget(),
metrics, aReflowStatus);
}
@ -2588,7 +2588,7 @@ nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,
// might have a soft hyphen which should now appear, changing the frame's
// width
nsTextFrame::TrimOutput trimOutput = static_cast<nsTextFrame*>(pfd->mFrame)->
TrimTrailingWhiteSpace(mBlockReflowState->rendContext->GetDrawTarget());
TrimTrailingWhiteSpace(mBlockReflowState->mRenderingContext->GetDrawTarget());
#ifdef NOISY_TRIM
nsFrame::ListTag(stdout, psd->mFrame->mFrame);
printf(": trim of ");

Просмотреть файл

@ -582,7 +582,7 @@ nsRubyBaseContainerFrame::ReflowOneColumn(const ReflowState& aReflowState,
aReflowState.mAllowLineBreak : aReflowState.mAllowInitialLineBreak;
if (allowBreakBefore) {
gfxBreakPriority breakPriority = LineBreakBefore(
aColumn.mBaseFrame, baseReflowState.rendContext->GetDrawTarget(),
aColumn.mBaseFrame, baseReflowState.mRenderingContext->GetDrawTarget(),
baseReflowState.mLineLayout->LineContainerFrame(),
baseReflowState.mLineLayout->GetLine());
if (breakPriority != gfxBreakPriority::eNoBreak) {

Просмотреть файл

@ -8667,7 +8667,7 @@ nsTextFrame::Reflow(nsPresContext* aPresContext,
}
ReflowText(*aReflowState.mLineLayout, aReflowState.AvailableWidth(),
aReflowState.rendContext->GetDrawTarget(), aMetrics, aStatus);
aReflowState.mRenderingContext->GetDrawTarget(), aMetrics, aStatus);
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
}

Просмотреть файл

@ -339,7 +339,7 @@ nsVideoFrame::Reflow(nsPresContext* aPresContext,
posterRenderRect.x, posterRenderRect.y, 0);
} else if (child->GetContent() == mVideoControls) {
// Reflow the video controls frame.
nsBoxLayoutState boxState(PresContext(), aReflowState.rendContext);
nsBoxLayoutState boxState(PresContext(), aReflowState.mRenderingContext);
nsSize size = child->GetSize();
nsBoxFrame::LayoutChildAt(boxState,
child,

Просмотреть файл

@ -857,7 +857,7 @@ nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
}
if (IsForeignChild(aChildFrame)) {
// use ComputeTightBounds API as aDesiredSize.mBoundingMetrics is not set.
nsRect r = aChildFrame->ComputeTightBounds(aReflowState.rendContext->GetDrawTarget());
nsRect r = aChildFrame->ComputeTightBounds(aReflowState.mRenderingContext->GetDrawTarget());
aDesiredSize.mBoundingMetrics.leftBearing = r.x;
aDesiredSize.mBoundingMetrics.rightBearing = r.XMost();
aDesiredSize.mBoundingMetrics.ascent = aDesiredSize.BlockStartAscent() - r.y;
@ -907,7 +907,7 @@ nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext,
// The stretching of siblings of an embellished child is _deferred_ until
// after finishing the stretching of the embellished child - bug 117652
DrawTarget* drawTarget = aReflowState.rendContext->GetDrawTarget();
DrawTarget* drawTarget = aReflowState.mRenderingContext->GetDrawTarget();
if (!NS_MATHML_IS_EMBELLISH_OPERATOR(mEmbellishData.flags) &&
(NS_MATHML_WILL_STRETCH_ALL_CHILDREN_VERTICALLY(mPresentationData.flags) ||

Просмотреть файл

@ -157,7 +157,7 @@ nsMathMLSelectedFrame::Reflow(nsPresContext* aPresContext,
aDesiredSize.mBoundingMetrics);
mBoundingMetrics = aDesiredSize.mBoundingMetrics;
}
FinalizeReflow(aReflowState.rendContext->GetDrawTarget(), aDesiredSize);
FinalizeReflow(aReflowState.mRenderingContext->GetDrawTarget(), aDesiredSize);
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}

Просмотреть файл

@ -150,7 +150,7 @@ nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,
}
// place and size children
FinalizeReflow(aReflowState.rendContext->GetDrawTarget(), aDesiredSize);
FinalizeReflow(aReflowState.mRenderingContext->GetDrawTarget(), aDesiredSize);
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);

Просмотреть файл

@ -226,7 +226,7 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetFontMetricsForFrame(this, fontSizeInflation);
nscoord axisHeight, em;
GetAxisHeight(aReflowState.rendContext->GetDrawTarget(), fm, axisHeight);
GetAxisHeight(aReflowState.mRenderingContext->GetDrawTarget(), fm, axisHeight);
GetEmHeight(fm, em);
// leading to be left at the top and the bottom of stretched chars
nscoord leading = NSToCoordRound(0.2f * em);
@ -286,7 +286,7 @@ nsMathMLmfencedFrame::Reflow(nsPresContext* aPresContext,
nsBoundingMetrics containerSize;
nsStretchDirection stretchDir = NS_STRETCH_DIRECTION_VERTICAL;
DrawTarget* drawTarget = aReflowState.rendContext->GetDrawTarget();
DrawTarget* drawTarget = aReflowState.mRenderingContext->GetDrawTarget();
GetPreferredStretchSize(drawTarget,
0, /* i.e., without embellishments */

Просмотреть файл

@ -172,7 +172,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
aDesiredSize.SetBlockStartAscent(0);
nsBoundingMetrics bmSqr, bmBase, bmIndex;
DrawTarget* drawTarget = aReflowState.rendContext->GetDrawTarget();
DrawTarget* drawTarget = aReflowState.mRenderingContext->GetDrawTarget();
//////////////////
// Reflow Children

Просмотреть файл

@ -890,7 +890,7 @@ nsMathMLmtableWrapperFrame::Reflow(nsPresContext* aPresContext,
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetInflatedFontMetricsForFrame(this);
nscoord axisHeight;
GetAxisHeight(aReflowState.rendContext->GetDrawTarget(), fm, axisHeight);
GetAxisHeight(aReflowState.mRenderingContext->GetDrawTarget(), fm, axisHeight);
if (rowFrame) {
// anchor the table on the axis of the row of reference
// XXX fallback to baseline because it is a hard problem

Просмотреть файл

@ -537,7 +537,7 @@ BasicTableLayoutStrategy::ComputeColumnISizes(const ReflowInput& aReflowState)
"dirtyness out of sync");
// XXX Is this needed?
if (mMinISize == NS_INTRINSIC_WIDTH_UNKNOWN) {
ComputeIntrinsicISizes(aReflowState.rendContext);
ComputeIntrinsicISizes(aReflowState.mRenderingContext);
}
nsTableCellMap *cellMap = mTableFrame->GetCellMap();

Просмотреть файл

@ -213,7 +213,7 @@ FixedTableLayoutStrategy::ComputeColumnISizes(const ReflowInput& aReflowState)
const nsStyleCoord *styleISize = &colFrame->StylePosition()->ISize(wm);
nscoord colISize;
if (styleISize->ConvertsToLength()) {
colISize = nsLayoutUtils::ComputeISizeValue(aReflowState.rendContext,
colISize = nsLayoutUtils::ComputeISizeValue(aReflowState.mRenderingContext,
colFrame, 0, 0, 0,
*styleISize);
specTotal += colISize;
@ -247,7 +247,7 @@ FixedTableLayoutStrategy::ComputeColumnISizes(const ReflowInput& aReflowState)
// MIN_ISIZE for symmetry with GetMinISize above, just in case
// there is a difference.
colISize =
nsLayoutUtils::IntrinsicForContainer(aReflowState.rendContext,
nsLayoutUtils::IntrinsicForContainer(aReflowState.mRenderingContext,
cellFrame,
nsLayoutUtils::MIN_ISIZE);
} else if (styleISize->GetUnit() == eStyleUnit_Percent) {

Просмотреть файл

@ -2019,7 +2019,7 @@ nsTableFrame::FixupPositionedTableParts(nsPresContext* aPresContext,
LogicalSize availSize(wm, size);
availSize.BSize(wm) = NS_UNCONSTRAINEDSIZE;
ReflowInput reflowState(aPresContext, positionedPart,
aReflowState.rendContext, availSize,
aReflowState.mRenderingContext, availSize,
ReflowInput::DUMMY_PARENT_REFLOW_STATE);
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
@ -2092,7 +2092,7 @@ nsTableFrame::ReflowTable(ReflowOutput& aDesiredSize,
ReflowChildren(reflowState, aStatus, aLastChildReflowed,
aDesiredSize.mOverflowAreas);
ReflowColGroups(aReflowState.rendContext);
ReflowColGroups(aReflowState.mRenderingContext);
}
nsIFrame*

Просмотреть файл

@ -659,7 +659,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
aStatus = NS_FRAME_COMPLETE;
// create the layout state
nsBoxLayoutState state(aPresContext, aReflowState.rendContext,
nsBoxLayoutState state(aPresContext, aReflowState.mRenderingContext,
&aReflowState, aReflowState.mReflowDepth);
WritingMode wm = aReflowState.GetWritingMode();

Просмотреть файл

@ -238,7 +238,7 @@ nsLeafBoxFrame::Reflow(nsPresContext* aPresContext,
aStatus = NS_FRAME_COMPLETE;
// create the layout state
nsBoxLayoutState state(aPresContext, aReflowState.rendContext);
nsBoxLayoutState state(aPresContext, aReflowState.mRenderingContext);
nsSize computedSize(aReflowState.ComputedWidth(),aReflowState.ComputedHeight());