Bug 1267524 Part 6 - Use member initializer list for nsStylePosition.
MozReview-Commit-ID: En2yLFd0WGs
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -1450,16 +1450,30 @@ bool nsStyleSVGPaint::operator==(const n
return mPaint.mColor == aOther.mPaint.mColor;
return true;
}
// --------------------
// nsStylePosition
//
nsStylePosition::nsStylePosition(StyleStructContext aContext)
+ : mGridAutoFlow(NS_STYLE_GRID_AUTO_FLOW_ROW)
+ , mBoxSizing(StyleBoxSizing::Content)
+ , mAlignContent(NS_STYLE_ALIGN_NORMAL)
+ , mAlignItems(NS_STYLE_ALIGN_NORMAL)
+ , mAlignSelf(NS_STYLE_ALIGN_AUTO)
+ , mJustifyContent(NS_STYLE_JUSTIFY_NORMAL)
+ , mJustifyItems(NS_STYLE_JUSTIFY_AUTO)
+ , mJustifySelf(NS_STYLE_JUSTIFY_AUTO)
+ , mFlexDirection(NS_STYLE_FLEX_DIRECTION_ROW)
+ , mFlexWrap(NS_STYLE_FLEX_WRAP_NOWRAP)
+ , mObjectFit(NS_STYLE_OBJECT_FIT_FILL)
+ , mOrder(NS_STYLE_ORDER_INITIAL)
+ , mFlexGrow(0.0f)
+ , mFlexShrink(1.0f)
{
MOZ_COUNT_CTOR(nsStylePosition);
// positioning values not inherited
mObjectPosition.SetInitialPercentValues(0.5f);
nsStyleCoord autoCoord(eStyleUnit_Auto);
@@ -1477,30 +1491,16 @@ nsStylePosition::nsStylePosition(StyleSt
// The initial value of grid-auto-columns and grid-auto-rows is 'auto',
// which computes to 'minmax(auto, auto)'.
mGridAutoColumnsMin.SetAutoValue();
mGridAutoColumnsMax.SetAutoValue();
mGridAutoRowsMin.SetAutoValue();
mGridAutoRowsMax.SetAutoValue();
- mGridAutoFlow = NS_STYLE_GRID_AUTO_FLOW_ROW;
- mBoxSizing = StyleBoxSizing::Content;
- mAlignContent = NS_STYLE_ALIGN_NORMAL;
- mAlignItems = NS_STYLE_ALIGN_NORMAL;
- mAlignSelf = NS_STYLE_ALIGN_AUTO;
- mJustifyContent = NS_STYLE_JUSTIFY_NORMAL;
- mJustifyItems = NS_STYLE_JUSTIFY_AUTO;
- mJustifySelf = NS_STYLE_JUSTIFY_AUTO;
- mFlexDirection = NS_STYLE_FLEX_DIRECTION_ROW;
- mFlexWrap = NS_STYLE_FLEX_WRAP_NOWRAP;
- mObjectFit = NS_STYLE_OBJECT_FIT_FILL;
- mOrder = NS_STYLE_ORDER_INITIAL;
- mFlexGrow = 0.0f;
- mFlexShrink = 1.0f;
mZIndex.SetAutoValue();
// Other members get their default constructors
// which initialize them to representations of their respective initial value.
// mGridTemplateAreas: nullptr for 'none'
// mGridTemplate{Rows,Columns}: false and empty arrays for 'none'
// mGrid{Column,Row}{Start,End}: false/0/empty values for 'auto'
}