Bug 1223653 patch 2 - Use an enum class for NS_STYLE_BOX_SIZING_*. r=heycam
The casts in nsCSSProps.cpp (defining kBoxSizingKTable) and in nsComputedDOMStyle::DoGetBoxSizing (using nsCSSProps::ValueToKeywordEnum) are a little bit annoying, though aren't a net reduction in typesafety. The casts in nsRuleNode.cpp (SetDiscrete) are a little more annoying, though the change in this patch should be sufficient for converting all properties -- but that may also mean reducing typesafety a bit for all properties. I'd like to find something better to do about them, but I think I'm ok landing this before doing that. Bug 1224918 covers doing better.
This commit is contained in:
@@ -121,16 +121,15 @@ GetISizeInfo(nsRenderingContext *aRenderingContext,
|
||||
}
|
||||
else {
|
||||
switch (stylePos->mBoxSizing) {
|
||||
case NS_STYLE_BOX_SIZING_CONTENT:
|
||||
case StyleBoxSizing::Content:
|
||||
boxSizingToBorderEdge = offsets.hPadding + offsets.hBorder;
|
||||
break;
|
||||
case NS_STYLE_BOX_SIZING_PADDING:
|
||||
case StyleBoxSizing::Padding:
|
||||
minCoord += offsets.hPadding;
|
||||
prefCoord += offsets.hPadding;
|
||||
boxSizingToBorderEdge = offsets.hBorder;
|
||||
break;
|
||||
default:
|
||||
// NS_STYLE_BOX_SIZING_BORDER
|
||||
case StyleBoxSizing::Border:
|
||||
minCoord += offsets.hPadding + offsets.hBorder;
|
||||
prefCoord += offsets.hPadding + offsets.hBorder;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user