Bug 1174546 part 2 - [css-grid] Implement the 'auto' min-sizing function in Grid layout. r=jfkthame

This commit is contained in:
Mats Palmgren 2015-09-04 22:06:57 +02:00
parent 04c2ee449f
commit 891bf53892
2 changed files with 20 additions and 0 deletions

View File

@ -225,10 +225,13 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::TrackSizingFunctions
*/
struct MOZ_STACK_CLASS nsGridContainerFrame::Tracks
{
explicit Tracks(Dimension aDimension) : mDimension(aDimension) {}
void Initialize(const TrackSizingFunctions& aFunctions,
nscoord aPercentageBasis);
nsAutoTArray<TrackSize, 32> mSizes;
Dimension mDimension;
};
struct MOZ_STACK_CLASS nsGridContainerFrame::GridReflowState
@ -267,6 +270,8 @@ private:
const WritingMode& aWM)
: mIter(aFrame, kPrincipalList)
, mGridStyle(aGridStyle)
, mCols(eColDimension)
, mRows(eRowDimension)
, mColFunctions({
mGridStyle->mGridTemplateColumns.mMinTrackSizingFunctions,
mGridStyle->mGridTemplateColumns.mMaxTrackSizingFunctions,
@ -1252,6 +1257,19 @@ nsGridContainerFrame::Tracks::Initialize(const TrackSizingFunctions& aFunctions,
}
}
#if 0
static nscoord
MinSize(nsIFrame* aChild, nsRenderingContext* aRC, WritingMode aCBWM,
nsGridContainerFrame::Dimension aDimension,
nsLayoutUtils::IntrinsicISizeType aConstraint)
{
PhysicalAxis axis(((aDimension == nsGridContainerFrame::eColDimension) ==
aCBWM.IsVertical()) ? eAxisVertical : eAxisHorizontal);
return nsLayoutUtils::MinSizeContributionForAxis(axis, aRC, aChild,
aConstraint);
}
#endif
void
nsGridContainerFrame::CalculateTrackSizes(GridReflowState& aState,
const LogicalSize& aContentBox)

View File

@ -54,6 +54,8 @@ public:
nscoord mLimit;
};
enum Dimension { eColDimension, eRowDimension };
// @see nsAbsoluteContainingBlock::Reflow about this magic number
static const nscoord VERY_LIKELY_A_GRID_CONTAINER = -123456789;