diff --git a/layout/generic/BlockReflowInput.cpp b/layout/generic/BlockReflowInput.cpp index 19f6d785522d..3113ce9f18ad 100644 --- a/layout/generic/BlockReflowInput.cpp +++ b/layout/generic/BlockReflowInput.cpp @@ -264,13 +264,13 @@ BlockReflowInput::ComputeBlockAvailSpace(nsIFrame* aFrame, const nsStyleBorder* borderStyle = aFrame->StyleBorder(); switch (borderStyle->mFloatEdge) { default: - case NS_STYLE_FLOAT_EDGE_CONTENT_BOX: // content and only content does runaround of floats + case StyleFloatEdge::ContentBox: // content and only content does runaround of floats // The child block will flow around the float. Therefore // give it all of the available space. aResult.IStart(wm) = mContentArea.IStart(wm); aResult.ISize(wm) = mContentArea.ISize(wm); break; - case NS_STYLE_FLOAT_EDGE_MARGIN_BOX: + case StyleFloatEdge::MarginBox: { // The child block's margins should be placed adjacent to, // but not overlap the float. diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 0b80a78bcc05..f1c0bf68a34b 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -1491,8 +1491,8 @@ KTableEntry nsCSSProps::kFloatKTable[] = { }; const KTableEntry nsCSSProps::kFloatEdgeKTable[] = { - { eCSSKeyword_content_box, NS_STYLE_FLOAT_EDGE_CONTENT_BOX }, - { eCSSKeyword_margin_box, NS_STYLE_FLOAT_EDGE_MARGIN_BOX }, + { eCSSKeyword_content_box, uint8_t(StyleFloatEdge::ContentBox) }, + { eCSSKeyword_margin_box, uint8_t(StyleFloatEdge::MarginBox) }, { eCSSKeyword_UNKNOWN, -1 } }; diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 29f2a71ceaab..7c951787fd19 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -4404,7 +4404,7 @@ nsComputedDOMStyle::DoGetFloatEdge() { RefPtr val = new nsROCSSPrimitiveValue; val->SetIdent( - nsCSSProps::ValueToKeywordEnum(StyleBorder()->mFloatEdge, + nsCSSProps::ValueToKeywordEnum(uint8_t(StyleBorder()->mFloatEdge), nsCSSProps::kFloatEdgeKTable)); return val.forget(); } diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index cafa06de47bd..ae2afc16aa9c 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -1301,6 +1301,7 @@ struct SetEnumValueHelper } DEFINE_ENUM_CLASS_SETTER(StyleBoxSizing, Content, Border) + DEFINE_ENUM_CLASS_SETTER(StyleFloatEdge, ContentBox, MarginBox) #undef DEF_SET_ENUMERATED_VALUE }; @@ -7578,7 +7579,7 @@ nsRuleNode::ComputeBorderData(void* aStartStruct, border->mFloatEdge, conditions, SETVAL_ENUMERATED | SETVAL_UNSET_INITIAL, parentBorder->mFloatEdge, - NS_STYLE_FLOAT_EDGE_CONTENT_BOX); + StyleFloatEdge::ContentBox); // border-image-source const nsCSSValue* borderImageSource = aRuleData->ValueForBorderImageSource(); diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h index e9b65d39d254..dc5d13c51908 100644 --- a/layout/style/nsStyleConsts.h +++ b/layout/style/nsStyleConsts.h @@ -95,8 +95,10 @@ enum class StyleClipShapeSizing : uint8_t { }; // float-edge -#define NS_STYLE_FLOAT_EDGE_CONTENT_BOX 0 -#define NS_STYLE_FLOAT_EDGE_MARGIN_BOX 1 +enum class StyleFloatEdge : uint8_t { + ContentBox, + MarginBox, +}; // user-focus #define NS_STYLE_USER_FOCUS_NONE 0 diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index ab23b37ae9f5..595c8d19f81d 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -332,7 +332,7 @@ nsStyleBorder::nsStyleBorder(StyleStructContext aContext) , mBorderImageFill(NS_STYLE_BORDER_IMAGE_SLICE_NOFILL) , mBorderImageRepeatH(NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH) , mBorderImageRepeatV(NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH) - , mFloatEdge(NS_STYLE_FLOAT_EDGE_CONTENT_BOX) + , mFloatEdge(StyleFloatEdge::ContentBox) , mBoxDecorationBreak(NS_STYLE_BOX_DECORATION_BREAK_SLICE) , mComputedBorder(0, 0, 0, 0) { @@ -2855,7 +2855,7 @@ StyleTransition::SetUnknownProperty(nsCSSProperty aProperty, } bool -StyleTransition::operator==(const mozilla::StyleTransition& aOther) const +StyleTransition::operator==(const StyleTransition& aOther) const { return mTimingFunction == aOther.mTimingFunction && mDuration == aOther.mDuration && @@ -2865,7 +2865,7 @@ StyleTransition::operator==(const mozilla::StyleTransition& aOther) const mUnknownProperty == aOther.mUnknownProperty); } -StyleAnimation::StyleAnimation(const mozilla::StyleAnimation& aCopy) +StyleAnimation::StyleAnimation(const StyleAnimation& aCopy) : mTimingFunction(aCopy.mTimingFunction) , mDuration(aCopy.mDuration) , mDelay(aCopy.mDelay) @@ -2891,7 +2891,7 @@ StyleAnimation::SetInitialValues() } bool -StyleAnimation::operator==(const mozilla::StyleAnimation& aOther) const +StyleAnimation::operator==(const StyleAnimation& aOther) const { return mTimingFunction == aOther.mTimingFunction && mDuration == aOther.mDuration && diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 98d370a5b859..2a26f028bd90 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -1260,7 +1260,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder } public: - nsBorderColors** mBorderColors; // [reset] composite (stripe) colors + nsBorderColors** mBorderColors; // [reset] composite (stripe) colors nsStyleCorners mBorderRadius; // [reset] coord, percent nsStyleImage mBorderImageSource; // [reset] nsStyleSides mBorderImageSlice; // [reset] factor, percent @@ -1270,7 +1270,7 @@ public: uint8_t mBorderImageFill; // [reset] uint8_t mBorderImageRepeatH; // [reset] see nsStyleConsts.h uint8_t mBorderImageRepeatV; // [reset] - uint8_t mFloatEdge; // [reset] + mozilla::StyleFloatEdge mFloatEdge; // [reset] uint8_t mBoxDecorationBreak; // [reset] see nsStyleConsts.h protected: