Bug 1575305 Part 4 - Improve column set log. r=dbaron

1. Add `this` to the log so that it's easier to debug a nested column
balancing

2. Print the struct fields the same as their names.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2019-08-21 00:25:07 +00:00
Родитель 913e451679
Коммит 0958d8ea88
1 изменённых файлов: 21 добавлений и 11 удалений

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

@ -419,12 +419,6 @@ nsColumnSetFrame::ReflowConfig nsColumnSetFrame::ChooseColumnStrategy(
colBSize = std::max(colBSize, nsPresContext::CSSPixelsToAppUnits(1));
}
COLUMN_SET_LOG(
"%s: numColumns=%d, colISize=%d, expectedISizeLeftOver=%d,"
" colBSize=%d, colGap=%d, isBalancing %d",
__func__, numColumns, colISize, expectedISizeLeftOver, colBSize, colGap,
isBalancing);
ReflowConfig config;
config.mBalanceColCount = numColumns;
config.mColISize = colISize;
@ -437,6 +431,13 @@ nsColumnSetFrame::ReflowConfig nsColumnSetFrame::ChooseColumnStrategy(
config.mComputedBSize = computedBSize;
config.mConsumedBSize = consumedBSize;
COLUMN_SET_LOG(
"%s: this=%p, mBalanceColCount=%d, mColISize=%d, "
"mExpectedISizeLeftOver=%d, mColGap=%d, mColMaxBSize=%d, mIsBalancing=%d",
__func__, this, config.mBalanceColCount, config.mColISize,
config.mExpectedISizeLeftOver, config.mColGap, config.mColMaxBSize,
config.mIsBalancing);
return config;
}
@ -722,6 +723,11 @@ nsColumnSetFrame::ColumnBalanceData nsColumnSetFrame::ReflowChildren(
LogicalSize availSize(wm, aConfig.mColISize, aConfig.mColMaxBSize);
if (aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1) {
availSize.BSize(wm) = GetAvailableContentBSize(aReflowInput);
COLUMN_SET_LOG(
"%s: Measuring content block-size, change available block-size "
"from %d to %d",
__func__, aConfig.mColMaxBSize, availSize.BSize(wm));
}
if (reflowNext) {
@ -998,8 +1004,11 @@ nsColumnSetFrame::ColumnBalanceData nsColumnSetFrame::ReflowChildren(
colData.mFeasible =
allFit && aStatus.IsFullyComplete() && !aStatus.IsTruncated();
COLUMN_SET_LOG("%s: Done column reflow pass: %s", __func__,
colData.mFeasible ? "Feasible :)" : "Infeasible :(");
COLUMN_SET_LOG(
"%s: Done column reflow pass: %s, mMaxBSize=%d, mSumBSize=%d, "
"mMaxOverflowingBSize=%d",
__func__, colData.mFeasible ? "Feasible :)" : "Infeasible :(",
colData.mMaxBSize, colData.mSumBSize, colData.mMaxOverflowingBSize);
return colData;
}
@ -1082,9 +1091,10 @@ void nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowInput,
}
}
COLUMN_SET_LOG("%s: KnownInfeasibleBSize=%d, KnownFeasibleBSize=%d",
__func__, aConfig.mKnownInfeasibleBSize,
aConfig.mKnownFeasibleBSize);
COLUMN_SET_LOG(
"%s: this=%p, mKnownInfeasibleBSize=%d, mKnownFeasibleBSize=%d",
__func__, this, aConfig.mKnownInfeasibleBSize,
aConfig.mKnownFeasibleBSize);
if (aConfig.mKnownInfeasibleBSize >= aConfig.mKnownFeasibleBSize - 1) {
// aConfig.mKnownFeasibleBSize is where we want to be