зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1288383 - Replace NS_STYLE_FLOAT_EDGE_* with an enum class; r=heycam
MozReview-Commit-ID: FrH5kGWeXkL --HG-- extra : rebase_source : 73c3446ba07f31f3fbfb6eca304ebe88cccf359a
This commit is contained in:
Родитель
b3653dd18e
Коммит
d78a51cbcc
|
@ -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.
|
||||
|
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
@ -4404,7 +4404,7 @@ nsComputedDOMStyle::DoGetFloatEdge()
|
|||
{
|
||||
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
|
||||
val->SetIdent(
|
||||
nsCSSProps::ValueToKeywordEnum(StyleBorder()->mFloatEdge,
|
||||
nsCSSProps::ValueToKeywordEnum(uint8_t(StyleBorder()->mFloatEdge),
|
||||
nsCSSProps::kFloatEdgeKTable));
|
||||
return val.forget();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 &&
|
||||
|
|
|
@ -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:
|
||||
|
|
Загрузка…
Ссылка в новой задаче