Bug 1316051 part 1 - Make ChildShrinkWrapISize a method instead of a static function, to prepare for changes in the next patch (idempotent change). r=dholbert

This commit is contained in:
Mats Palmgren 2016-11-18 19:08:31 +01:00
Родитель f4ed6903f6
Коммит 96e3be5ad8
2 изменённых файлов: 22 добавлений и 11 удалений

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

@ -360,14 +360,13 @@ nsTableWrapperFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
return maxISize;
}
// Compute the margin-box inline size of aChildFrame given the inputs.
// If aMarginResult is non-null, fill it with the part of the
// margin-isize that was contributed by the margin.
static nscoord
ChildShrinkWrapISize(nsRenderingContext *aRenderingContext,
nsIFrame *aChildFrame, WritingMode aWM,
LogicalSize aCBSize, nscoord aAvailableISize,
nscoord *aMarginResult = nullptr)
nscoord
nsTableWrapperFrame::ChildShrinkWrapISize(nsRenderingContext* aRenderingContext,
nsIFrame* aChildFrame,
WritingMode aWM,
LogicalSize aCBSize,
nscoord aAvailableISize,
nscoord* aMarginResult) const
{
AutoMaybeDisableFontInflation an(aChildFrame);
@ -375,14 +374,13 @@ ChildShrinkWrapISize(nsRenderingContext *aRenderingContext,
WritingMode childWM = aChildFrame->GetWritingMode();
SizeComputationInput offsets(aChildFrame, aRenderingContext, aWM,
aCBSize.ISize(aWM));
aCBSize.ISize(aWM));
LogicalSize marginSize =
offsets.ComputedLogicalMargin().Size(childWM).ConvertTo(aWM, childWM);
LogicalSize paddingSize =
offsets.ComputedLogicalPadding().Size(childWM).ConvertTo(aWM, childWM);
LogicalSize bpSize =
offsets.ComputedLogicalBorderPadding().Size(childWM).ConvertTo(aWM,
childWM);
offsets.ComputedLogicalBorderPadding().Size(childWM).ConvertTo(aWM, childWM);
LogicalSize size =
aChildFrame->ComputeSize(aRenderingContext, aWM, aCBSize, aAvailableISize,
marginSize, bpSize - paddingSize, paddingSize,

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

@ -262,6 +262,19 @@ protected:
return static_cast<nsTableFrame*>(mFrames.FirstChild());
}
/**
* Helper for ComputeAutoSize.
* Compute the margin-box inline size of aChildFrame given the inputs.
* If aMarginResult is non-null, fill it with the part of the
* margin-isize that was contributed by the margin.
*/
nscoord ChildShrinkWrapISize(nsRenderingContext* aRenderingContext,
nsIFrame* aChildFrame,
mozilla::WritingMode aWM,
mozilla::LogicalSize aCBSize,
nscoord aAvailableISize,
nscoord* aMarginResult = nullptr) const;
private:
nsFrameList mCaptionFrames;
};