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
Родитель 2093345fc9
Коммит 8a3d69f370
1 изменённых файлов: 4 добавлений и 13 удалений

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

@ -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 */