Bug 1174003 part 2: [css-flexbox] Reformat code around GetMinimumWidgetSize call slightly. r=mats

This patch doesn't change behavior. It's purely to allow the next patch to be more surgical. Specifically, this patch:
 - splits a subtract-and-clamp operation into two separate operations.
 - splits one a comment into two.
...so that the next patch can swap out these variables for new ones, without
pushing these lines over 80 characters.

MozReview-Commit-ID: 4N5sI755CqF

--HG--
extra : rebase_source : 96af106d739256a6871e75d0d34e9691cfbfb0c2
This commit is contained in:
Daniel Holbert 2018-02-27 11:26:43 -08:00
Родитель 375dc5dc6e
Коммит 3dfe09e9e1
1 изменённых файлов: 7 добавлений и 6 удалений

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

@ -1282,13 +1282,14 @@ nsFlexContainerFrame::GenerateFlexItemForChild(
aPresContext->DevPixelsToAppUnits(
aAxisTracker.GetCrossComponent(widgetMinSize));
// GMWS() returns border-box. We need content-box, so subtract
// borderPadding (but don't let that push our min sizes below 0).
// GetMinimumWidgetSize() returns border-box. We need content-box, so
// subtract borderPadding.
nsMargin& bp = childRI.ComputedPhysicalBorderPadding();
widgetMainMinSize = std::max(widgetMainMinSize -
aAxisTracker.GetMarginSizeInMainAxis(bp), 0);
widgetCrossMinSize = std::max(widgetCrossMinSize -
aAxisTracker.GetMarginSizeInCrossAxis(bp), 0);
widgetMainMinSize -= aAxisTracker.GetMarginSizeInMainAxis(bp);
widgetCrossMinSize -= aAxisTracker.GetMarginSizeInCrossAxis(bp);
// ... (but don't let that push these min sizes below 0).
widgetMainMinSize = std::max(0, widgetMainMinSize);
widgetCrossMinSize = std::max(0, widgetCrossMinSize);
if (!canOverride) {
// Fixed-size widget: freeze our main-size at the widget's mandated size.