Bug 1501145 Part 1 - Assign default values to ReflowConfig fields, and explicitly initialize them in ChooseColumnStrategy. r=mats

The original statement is neat, but one cannot easily associates the values
computed in ChooseColumnStrategy with the actually field name in ReflowConfig.

Remove the aFeasibleBSize and aInfeasibleBSize for ChooseColumnStrategy()
because they're not used.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2018-10-23 13:08:59 +00:00
Родитель bad6bf49d6
Коммит 4e6b53ce88
2 изменённых файлов: 24 добавлений и 20 удалений

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

@ -315,12 +315,8 @@ nsColumnSetFrame::ClampUsedColumnWidth(const nsStyleCoord& aColumnWidth)
nsColumnSetFrame::ReflowConfig
nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowInput,
bool aForceAuto = false,
nscoord aFeasibleBSize = NS_INTRINSICSIZE,
nscoord aInfeasibleBSize = 0)
bool aForceAuto = false)
{
nscoord knownFeasibleBSize = aFeasibleBSize;
nscoord knownInfeasibleBSize = aInfeasibleBSize;
WritingMode wm = aReflowInput.GetWritingMode();
const nsStyleColumn* colStyle = StyleColumn();
@ -456,9 +452,18 @@ nsColumnSetFrame::ChooseColumnStrategy(const ReflowInput& aReflowInput,
colBSize,
colGap);
ReflowConfig config = { numColumns, colISize, expectedISizeLeftOver, colGap,
colBSize, isBalancing, knownFeasibleBSize,
knownInfeasibleBSize, computedBSize, consumedBSize };
ReflowConfig config;
config.mBalanceColCount = numColumns;
config.mColISize = colISize;
config.mExpectedISizeLeftOver = expectedISizeLeftOver;
config.mColGap = colGap;
config.mColMaxBSize = colBSize;
config.mIsBalancing = isBalancing;
config.mKnownFeasibleBSize = NS_INTRINSICSIZE;
config.mKnownInfeasibleBSize = 0;
config.mComputedBSize = computedBSize;
config.mConsumedBSize = consumedBSize;
return config;
}

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

@ -102,42 +102,42 @@ protected:
struct ReflowConfig {
// The number of columns that we want to balance across. If we're not
// balancing, this will be set to INT32_MAX.
int32_t mBalanceColCount;
int32_t mBalanceColCount = INT32_MAX;
// The inline-size of each individual column.
nscoord mColISize;
nscoord mColISize = NS_INTRINSICSIZE;
// The amount of inline-size that is expected to be left over after all the
// columns and column gaps are laid out.
nscoord mExpectedISizeLeftOver;
nscoord mExpectedISizeLeftOver = 0;
// The width (inline-size) of each column gap.
nscoord mColGap;
nscoord mColGap = NS_INTRINSICSIZE;
// The maximum bSize of any individual column during a reflow iteration.
// This parameter is set during each iteration of the binary search for
// the best column block-size.
nscoord mColMaxBSize;
nscoord mColMaxBSize = NS_INTRINSICSIZE;
// A boolean controlling whether or not we are balancing. This should be
// equivalent to mBalanceColCount == INT32_MAX.
bool mIsBalancing;
bool mIsBalancing = false;
// The last known column block-size that was 'feasible'. A column bSize is
// feasible if all child content fits within the specified bSize.
nscoord mKnownFeasibleBSize;
nscoord mKnownFeasibleBSize = NS_INTRINSICSIZE;
// The last known block-size that was 'infeasible'. A column bSize is
// infeasible if not all child content fits within the specified bSize.
nscoord mKnownInfeasibleBSize;
nscoord mKnownInfeasibleBSize = 0;
// block-size of the column set frame
nscoord mComputedBSize;
nscoord mComputedBSize = NS_INTRINSICSIZE;
// The block-size "consumed" by previous-in-flows.
// The computed block-size should be equal to the block-size of the element
// (i.e. the computed block-size itself) plus the consumed block-size.
nscoord mConsumedBSize;
nscoord mConsumedBSize = 0;
};
/**
@ -180,8 +180,7 @@ protected:
* the state machine that controls column balancing.
*/
ReflowConfig ChooseColumnStrategy(const ReflowInput& aReflowInput,
bool aForceAuto, nscoord aFeasibleBSize,
nscoord aInfeasibleBSize);
bool aForceAuto);
/**
* Perform the binary search for the best balance height for this column set.