--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -800,25 +800,21 @@ public:
// establish the cross size?
bool CanMainSizeInfluenceCrossSize(const FlexboxAxisTracker& aAxisTracker) const;
protected:
// Helper called by the constructor, to set mNeedsMinSizeAutoResolution:
void CheckForMinSizeAuto(const ReflowInput& aFlexItemReflowInput,
const FlexboxAxisTracker& aAxisTracker);
- // Our frame:
- nsIFrame* const mFrame;
-
- // Values that we already know in constructor: (and are hence mostly 'const')
+ // Values that we already know in constructor (and are hence mostly 'const'):
+ nsIFrame* const mFrame; // The flex item's frame.
const float mFlexGrow;
const float mFlexShrink;
-
const nsSize mIntrinsicRatio;
-
const nsMargin mBorderPadding;
nsMargin mMargin; // non-const because we need to resolve auto margins
// These are non-const so that we can lazily update them with the item's
// intrinsic size (obtained via a "measuring" reflow), when necessary.
// (e.g. for "flex-basis:auto;height:auto" & "min-height:auto")
nscoord mFlexBaseSize;
nscoord mMainMinSize;
@@ -836,31 +832,32 @@ protected:
// via const pointer. See comment above SetAscent().
// Temporary state, while we're resolving flexible widths (for our main size)
// XXXdholbert To save space, we could use a union to make these variables
// overlay the same memory as some other member vars that aren't touched
// until after main-size has been resolved. In particular, these could share
// memory with mMainPosn through mAscent, and mIsStretched.
float mShareOfWeightSoFar;
+
+ const WritingMode mWM; // The flex item's writing mode.
bool mIsFrozen;
bool mHadMinViolation;
bool mHadMaxViolation;
// Misc:
bool mHadMeasuringReflow; // Did this item get a preliminary reflow,
// to measure its desired height?
bool mIsStretched; // See IsStretched() documentation
bool mIsStrut; // Is this item a "strut" left behind by an element
// with visibility:collapse?
// Does this item need to resolve a min-[width|height]:auto (in main-axis).
bool mNeedsMinSizeAutoResolution;
- const WritingMode mWM; // The flex item's writing mode.
uint8_t mAlignSelf; // My "align-self" computed value (with "auto"
// swapped out for parent"s "align-items" value,
// in our constructor).
};
/**
* Represents a single flex line in a flex container.
* Manages a linked list of the FlexItems that are in the line.
@@ -1793,24 +1790,24 @@ FlexItem::FlexItem(ReflowInput& aFlexIte
mMainMaxSize(aMainMaxSize),
mCrossMinSize(aCrossMinSize),
mCrossMaxSize(aCrossMaxSize),
mMainPosn(0),
mCrossSize(aTentativeCrossSize),
mCrossPosn(0),
mAscent(0),
mShareOfWeightSoFar(0.0f),
+ mWM(aFlexItemReflowInput.GetWritingMode()),
mIsFrozen(false),
mHadMinViolation(false),
mHadMaxViolation(false),
mHadMeasuringReflow(false),
mIsStretched(false),
- mIsStrut(false),
+ mIsStrut(false)
// mNeedsMinSizeAutoResolution is initialized in CheckForMinSizeAuto()
- mWM(aFlexItemReflowInput.GetWritingMode())
// mAlignSelf, see below
{
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
MOZ_ASSERT(!mFrame->IsPlaceholderFrame(),
"placeholder frames should not be treated as flex items");
MOZ_ASSERT(!(mFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW),
"out-of-flow frames should not be treated as flex items");
@@ -1888,24 +1885,26 @@ FlexItem::FlexItem(nsIFrame* aChildFrame
mCrossMinSize(0),
mCrossMaxSize(0),
mMainSize(0),
mMainPosn(0),
mCrossSize(aCrossSize),
mCrossPosn(0),
mAscent(0),
mShareOfWeightSoFar(0.0f),
+ // Struts don't do layout, so its WM doesn't matter at this point. So, we
+ // just share container's WM for simplicity:
+ mWM(aContainerWM),
mIsFrozen(true),
mHadMinViolation(false),
mHadMaxViolation(false),
mHadMeasuringReflow(false),
mIsStretched(false),
mIsStrut(true), // (this is the constructor for making struts, after all)
mNeedsMinSizeAutoResolution(false),
- mWM(aContainerWM),
mAlignSelf(NS_STYLE_ALIGN_FLEX_START)
{
MOZ_ASSERT(mFrame, "expecting a non-null child frame");
MOZ_ASSERT(NS_STYLE_VISIBILITY_COLLAPSE ==
mFrame->StyleVisibility()->mVisible,
"Should only make struts for children with 'visibility:collapse'");
MOZ_ASSERT(!mFrame->IsPlaceholderFrame(),
"placeholder frames should not be treated as flex items");