Bug 1313565 - Convert NS_STYLE_ORIENT_* to enum class ; r=manishearth,xidorn

MozReview-Commit-ID: LHT6Aa2ojlf

--HG--
extra : rebase_source : cad726aee8e14d7ae60b899a76fcd26edb608507
This commit is contained in:
Adam Velebil 2016-10-28 06:17:20 +02:00
Родитель 389406c473
Коммит 33caf18ccc
7 изменённых файлов: 23 добавлений и 20 удалений

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

@ -1783,15 +1783,15 @@ nsContainerFrame::PullNextInFlowChild(ContinuationTraversingState& aState)
bool
nsContainerFrame::ResolvedOrientationIsVertical()
{
uint8_t orient = StyleDisplay()->mOrient;
StyleOrient orient = StyleDisplay()->mOrient;
switch (orient) {
case NS_STYLE_ORIENT_HORIZONTAL:
case StyleOrient::Horizontal:
return false;
case NS_STYLE_ORIENT_VERTICAL:
case StyleOrient::Vertical:
return true;
case NS_STYLE_ORIENT_INLINE:
case StyleOrient::Inline:
return GetWritingMode().IsVertical();
case NS_STYLE_ORIENT_BLOCK:
case StyleOrient::Block:
return !GetWritingMode().IsVertical();
}
NS_NOTREACHED("unexpected -moz-orient value");

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

@ -1786,10 +1786,10 @@ const KTableEntry nsCSSProps::kObjectFitKTable[] = {
};
const KTableEntry nsCSSProps::kOrientKTable[] = {
{ eCSSKeyword_inline, NS_STYLE_ORIENT_INLINE },
{ eCSSKeyword_block, NS_STYLE_ORIENT_BLOCK },
{ eCSSKeyword_horizontal, NS_STYLE_ORIENT_HORIZONTAL },
{ eCSSKeyword_vertical, NS_STYLE_ORIENT_VERTICAL },
{ eCSSKeyword_inline, StyleOrient::Inline },
{ eCSSKeyword_block, StyleOrient::Block },
{ eCSSKeyword_horizontal, StyleOrient::Horizontal },
{ eCSSKeyword_vertical, StyleOrient::Vertical },
{ eCSSKeyword_UNKNOWN, -1 }
};

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

@ -1420,6 +1420,7 @@ struct SetEnumValueHelper
DEFINE_ENUM_CLASS_SETTER(StyleUserInput, None, Auto)
DEFINE_ENUM_CLASS_SETTER(StyleUserModify, ReadOnly, WriteOnly)
DEFINE_ENUM_CLASS_SETTER(StyleWindowDragging, Default, NoDrag)
DEFINE_ENUM_CLASS_SETTER(StyleOrient, Inline, Vertical)
#ifdef MOZ_XUL
DEFINE_ENUM_CLASS_SETTER(StyleDisplay, None, Popup)
#else
@ -6454,7 +6455,7 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
display->mOrient, conditions,
SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL,
parentDisplay->mOrient,
NS_STYLE_ORIENT_INLINE);
StyleOrient::Inline);
// shape-outside: none | [ <basic-shape> || <shape-box> ] | <image>
const nsCSSValue* shapeOutsideValue = aRuleData->ValueForShapeOutside();

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

@ -234,10 +234,12 @@ enum class StyleWindowDragging : uint8_t {
};
// orient
#define NS_STYLE_ORIENT_INLINE 0
#define NS_STYLE_ORIENT_BLOCK 1
#define NS_STYLE_ORIENT_HORIZONTAL 2
#define NS_STYLE_ORIENT_VERTICAL 3
enum class StyleOrient : uint8_t {
Inline,
Block,
Horizontal,
Vertical,
};
#define NS_RADIUS_FARTHEST_SIDE 0
#define NS_RADIUS_CLOSEST_SIDE 1

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

@ -3133,7 +3133,7 @@ nsStyleDisplay::nsStyleDisplay(StyleStructContext aContext)
, mOverflowY(NS_STYLE_OVERFLOW_VISIBLE)
, mOverflowClipBox(NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX)
, mResize(NS_STYLE_RESIZE_NONE)
, mOrient(NS_STYLE_ORIENT_INLINE)
, mOrient(StyleOrient::Inline)
, mIsolation(NS_STYLE_ISOLATION_AUTO)
, mTopLayer(NS_STYLE_TOP_LAYER_NONE)
, mWillChangeBitField(0)

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

@ -2820,7 +2820,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleDisplay
uint8_t mOverflowY; // [reset] see nsStyleConsts.h
uint8_t mOverflowClipBox; // [reset] see nsStyleConsts.h
uint8_t mResize; // [reset] see nsStyleConsts.h
uint8_t mOrient; // [reset] see nsStyleConsts.h
mozilla::StyleOrient mOrient; // [reset] see nsStyleConsts.h
uint8_t mIsolation; // [reset] see nsStyleConsts.h
uint8_t mTopLayer; // [reset] see nsStyleConsts.h
uint8_t mWillChangeBitField; // [reset] see nsStyleConsts.h. Stores a

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

@ -564,13 +564,13 @@ nsNativeTheme::IsVerticalMeter(nsIFrame* aFrame)
{
NS_PRECONDITION(aFrame, "You have to pass a non-null aFrame");
switch (aFrame->StyleDisplay()->mOrient) {
case NS_STYLE_ORIENT_HORIZONTAL:
case StyleOrient::Horizontal:
return false;
case NS_STYLE_ORIENT_VERTICAL:
case StyleOrient::Vertical:
return true;
case NS_STYLE_ORIENT_INLINE:
case StyleOrient::Inline:
return aFrame->GetWritingMode().IsVertical();
case NS_STYLE_ORIENT_BLOCK:
case StyleOrient::Block:
return !aFrame->GetWritingMode().IsVertical();
}
NS_NOTREACHED("unexpected -moz-orient value");