Bug 520992, Followup 1: Simplify code in nsDOMComputedStyle for box-sizing adjustment for clarity. [r=me]

This commit is contained in:
Scott Johnson 2013-04-04 13:54:05 -05:00
parent bff30e6154
commit 1f3eeb1123

View File

@ -386,26 +386,17 @@ nsComputedDOMStyle::GetAdjustedValuesForBoxSizing()
nscoord borderPaddingTop = 0;
nscoord borderPaddingBottom = 0;
nsMargin border = mInnerFrame->GetUsedBorder();
nsMargin padding = mInnerFrame->GetUsedPadding();
nsMargin adjustment;
switch(stylePos->mBoxSizing) {
case NS_STYLE_BOX_SIZING_BORDER:
borderPaddingLeft += border.left;
borderPaddingRight += border.right;
borderPaddingTop += border.top;
borderPaddingBottom += border.bottom;
adjustment += mInnerFrame->GetUsedBorder();
// fall through
case NS_STYLE_BOX_SIZING_PADDING:
borderPaddingLeft += padding.left;
borderPaddingRight += padding.right;
borderPaddingTop += padding.top;
borderPaddingBottom += padding.bottom;
adjustment += mInnerFrame->GetUsedPadding();
}
return nsMargin(borderPaddingTop, borderPaddingRight, borderPaddingBottom,
borderPaddingLeft);
return adjustment;
}
/* static */