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
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -1277,23 +1277,24 @@ nsFlexContainerFrame::GenerateFlexItemFo
nscoord widgetMainMinSize =
aPresContext->DevPixelsToAppUnits(
aAxisTracker.GetMainComponent(widgetMinSize));
nscoord widgetCrossMinSize =
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.
// (Set min and max main-sizes to that size, too, to keep us from
// clamping to any other size later on.)
flexBaseSize = mainMinSize = mainMaxSize = widgetMainMinSize;
tentativeCrossSize = crossMinSize = crossMaxSize = widgetCrossMinSize;
isFixedSizeWidget = true;