Bug 1546223 Part 2 - Use in-class member initializer for those which were in constructor body. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D28428

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2019-04-24 00:20:05 +00:00
Родитель 328026b148
Коммит 77038b9a3a
2 изменённых файлов: 15 добавлений и 25 удалений

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

@ -57,13 +57,8 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext, nsIFrame* aFrame,
MOZ_ASSERT(aPresContext, "no pres context");
MOZ_ASSERT(aFrame, "no frame");
MOZ_ASSERT(aPresContext == aFrame->PresContext(), "wrong pres context");
mParentReflowInput = nullptr;
AvailableISize() = aAvailableSpace.ISize(mWritingMode);
AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
mFloatManager = nullptr;
mLineLayout = nullptr;
mDiscoveredClearance = nullptr;
mPercentBSizeObserver = nullptr;
if (aFlags & DUMMY_PARENT_REFLOW_INPUT) {
mFlags.mDummyParentReflowInput = true;
@ -172,6 +167,16 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext,
const LogicalSize* aContainingBlockSize,
uint32_t aFlags)
: SizeComputationInput(aFrame, aParentReflowInput.mRenderingContext),
mParentReflowInput(&aParentReflowInput),
mFloatManager(aParentReflowInput.mFloatManager),
mLineLayout(mFrame->IsFrameOfType(nsIFrame::eLineParticipant)
? aParentReflowInput.mLineLayout
: nullptr),
mPercentBSizeObserver(
(aParentReflowInput.mPercentBSizeObserver &&
aParentReflowInput.mPercentBSizeObserver->NeedsToObserve(*this))
? aParentReflowInput.mPercentBSizeObserver
: nullptr),
mFlags(aParentReflowInput.mFlags),
mReflowDepth(aParentReflowInput.mReflowDepth + 1) {
MOZ_ASSERT(aPresContext, "no pres context");
@ -180,8 +185,6 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext,
MOZ_ASSERT(!mFlags.mSpecialBSizeReflow || !NS_SUBTREE_DIRTY(aFrame),
"frame should be clean when getting special bsize reflow");
mParentReflowInput = &aParentReflowInput;
AvailableISize() = aAvailableSpace.ISize(mWritingMode);
AvailableBSize() = aAvailableSpace.BSize(mWritingMode);
@ -195,12 +198,6 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext,
}
}
mFloatManager = aParentReflowInput.mFloatManager;
if (mFrame->IsFrameOfType(nsIFrame::eLineParticipant))
mLineLayout = aParentReflowInput.mLineLayout;
else
mLineLayout = nullptr;
// Note: mFlags was initialized as a copy of aParentReflowInput.mFlags up in
// this constructor's init list, so the only flags that we need to explicitly
// initialize here are those that may need a value other than our parent's.
@ -219,13 +216,6 @@ ReflowInput::ReflowInput(nsPresContext* aPresContext,
mFlags.mBClampMarginBoxMinSize = !!(aFlags & B_CLAMP_MARGIN_BOX_MIN_SIZE);
mFlags.mApplyAutoMinSize = !!(aFlags & I_APPLY_AUTO_MIN_SIZE);
mDiscoveredClearance = nullptr;
mPercentBSizeObserver =
(aParentReflowInput.mPercentBSizeObserver &&
aParentReflowInput.mPercentBSizeObserver->NeedsToObserve(*this))
? aParentReflowInput.mPercentBSizeObserver
: nullptr;
if ((aFlags & DUMMY_PARENT_REFLOW_INPUT) ||
(mParentReflowInput->mFlags.mDummyParentReflowInput &&
mFrame->IsTableFrame())) {

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

@ -352,14 +352,14 @@ struct SizeComputationInput {
struct ReflowInput : public SizeComputationInput {
// the reflow inputs are linked together. this is the pointer to the
// parent's reflow input
const ReflowInput* mParentReflowInput;
const ReflowInput* mParentReflowInput = nullptr;
// A non-owning pointer to the float manager associated with this area,
// which points to the object owned by nsAutoFloatManager::mNew.
nsFloatManager* mFloatManager;
nsFloatManager* mFloatManager = nullptr;
// LineLayout object (only for inline reflow; set to nullptr otherwise)
nsLineLayout* mLineLayout;
nsLineLayout* mLineLayout = nullptr;
// The appropriate reflow input for the containing block (for
// percentage widths, etc.) of this reflow input's frame. It will be setup
@ -647,14 +647,14 @@ struct ReflowInput : public SizeComputationInput {
// a frame (e.g. nsTableCellFrame) which may need to generate a special
// reflow for percent bsize calculations
nsIPercentBSizeObserver* mPercentBSizeObserver;
nsIPercentBSizeObserver* mPercentBSizeObserver = nullptr;
// CSS margin collapsing sometimes requires us to reflow
// optimistically assuming that margins collapse to see if clearance
// is required. When we discover that clearance is required, we
// store the frame in which clearance was discovered to the location
// requested here.
nsIFrame** mDiscoveredClearance;
nsIFrame** mDiscoveredClearance = nullptr;
ReflowInputFlags mFlags;