Bug 1674774 Part 1 - Move two variables' definition closer to their usage. r=mats

Differential Revision: https://phabricator.services.mozilla.com/D97519
This commit is contained in:
Ting-Yu Lin 2020-12-01 05:45:49 +00:00
Родитель fed021b181
Коммит ed394cfbbc
1 изменённых файлов: 10 добавлений и 10 удалений

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

@ -4394,16 +4394,6 @@ void nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
// be filled out for use by devtools.
ComputedFlexContainerInfo* containerInfo = CreateOrClearFlexContainerInfo();
// We assume we are the last fragment by using
// PreReflowBlockLevelLogicalSkipSides(). We will skip block-end
// border/padding when we know our content-box size after DoFlexLayout.
LogicalMargin borderPadding =
aReflowInput.ComputedLogicalBorderPadding(wm).ApplySkipSides(
PreReflowBlockLevelLogicalSkipSides());
const LogicalSize availableSizeForItems =
ComputeAvailableSizeForItems(aReflowInput, borderPadding);
const nscoord consumedBSize = CalcAndCacheConsumedBSize();
nscoord contentBoxMainSize =
GetMainSizeFromReflowInput(aReflowInput, axisTracker, consumedBSize);
@ -4466,6 +4456,16 @@ void nsFlexContainerFrame::Reflow(nsPresContext* aPresContext,
contentBoxCrossSize = data->mContentBoxCrossSize;
}
// We assume we are the last fragment by using
// PreReflowBlockLevelLogicalSkipSides(), and skip block-end border and
// padding if needed.
LogicalMargin borderPadding =
aReflowInput.ComputedLogicalBorderPadding(wm).ApplySkipSides(
PreReflowBlockLevelLogicalSkipSides());
const LogicalSize availableSizeForItems =
ComputeAvailableSizeForItems(aReflowInput, borderPadding);
const LogicalSize contentBoxSize =
axisTracker.LogicalSizeFromFlexRelativeSizes(contentBoxMainSize,
contentBoxCrossSize);