зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1586068 - Replace #define NS_STYLE_FLEX_WRAP with enum class. r=emilio
MANUAL PUSH: Rebasing contributor patch. Differential Revision: https://phabricator.services.mozilla.com/D48166
This commit is contained in:
Родитель
da1a862fc2
Коммит
be6805c792
|
@ -1220,7 +1220,7 @@ uint16_t nsFlexContainerFrame::CSSAlignmentForAbsPosChild(
|
|||
const uint8_t alignContent = SimplifyAlignOrJustifyContentForOneItem(
|
||||
containerStylePos->mAlignContent,
|
||||
/*aIsAlign = */ true);
|
||||
if (NS_STYLE_FLEX_WRAP_NOWRAP != containerStylePos->mFlexWrap &&
|
||||
if (StyleFlexWrap::Nowrap != containerStylePos->mFlexWrap &&
|
||||
alignContent != NS_STYLE_ALIGN_STRETCH) {
|
||||
// Multi-line, align-content isn't stretch --> align-content determines
|
||||
// this child's alignment in the cross axis.
|
||||
|
@ -1600,7 +1600,7 @@ void nsFlexContainerFrame::ResolveAutoFlexBasisAndMinSize(
|
|||
const ReflowInput* flexContainerRI = aItemReflowInput.mParentReflowInput;
|
||||
MOZ_ASSERT(flexContainerRI,
|
||||
"flex item's reflow input should have ptr to container's state");
|
||||
if (NS_STYLE_FLEX_WRAP_NOWRAP == flexContainerRI->mStylePosition->mFlexWrap) {
|
||||
if (StyleFlexWrap::Nowrap == flexContainerRI->mStylePosition->mFlexWrap) {
|
||||
// XXXdholbert Maybe this should share logic with ComputeCrossSize()...
|
||||
// Alternately, maybe tentative container cross size should be passed down.
|
||||
nscoord containerCrossSize = GET_CROSS_COMPONENT_LOGICAL(
|
||||
|
@ -3150,7 +3150,7 @@ CrossAxisPositionTracker::CrossAxisPositionTracker(
|
|||
}
|
||||
|
||||
const bool isSingleLine =
|
||||
NS_STYLE_FLEX_WRAP_NOWRAP == aReflowInput.mStylePosition->mFlexWrap;
|
||||
StyleFlexWrap::Nowrap == aReflowInput.mStylePosition->mFlexWrap;
|
||||
if (isSingleLine) {
|
||||
MOZ_ASSERT(!aFirstLine->getNext(),
|
||||
"If we're styled as single-line, we should only have 1 line");
|
||||
|
@ -3782,7 +3782,7 @@ void FlexboxAxisTracker::InitAxesFromModernProps(
|
|||
}
|
||||
|
||||
// "flex-wrap: wrap-reverse" reverses our cross axis.
|
||||
if (stylePos->mFlexWrap == NS_STYLE_FLEX_WRAP_WRAP_REVERSE) {
|
||||
if (stylePos->mFlexWrap == StyleFlexWrap::WrapReverse) {
|
||||
mCrossAxis = GetReverseAxis(mCrossAxis);
|
||||
mIsCrossAxisReversed = true;
|
||||
} else {
|
||||
|
@ -3845,7 +3845,7 @@ void nsFlexContainerFrame::GenerateFlexLines(
|
|||
MOZ_ASSERT(aLines.isEmpty(), "Expecting outparam to start out empty");
|
||||
|
||||
const bool isSingleLine =
|
||||
NS_STYLE_FLEX_WRAP_NOWRAP == aReflowInput.mStylePosition->mFlexWrap;
|
||||
StyleFlexWrap::Nowrap == aReflowInput.mStylePosition->mFlexWrap;
|
||||
|
||||
// If we're transparently reversing axes, then we'll need to link up our
|
||||
// FlexItems and FlexLines in the reverse order, so that the rest of flex
|
||||
|
@ -5364,7 +5364,7 @@ nscoord nsFlexContainerFrame::IntrinsicISize(gfxContext* aRenderingContext,
|
|||
// is the max of its items' min isizes.
|
||||
// * For a row-oriented multi-line flex container, the intrinsic
|
||||
// pref isize is former (sum), and its min isize is the latter (max).
|
||||
bool isSingleLine = (NS_STYLE_FLEX_WRAP_NOWRAP == stylePos->mFlexWrap);
|
||||
bool isSingleLine = (StyleFlexWrap::Nowrap == stylePos->mFlexWrap);
|
||||
if (axisTracker.IsRowOriented() &&
|
||||
(isSingleLine || aType == nsLayoutUtils::PREF_ISIZE)) {
|
||||
containerISize += childISize;
|
||||
|
|
|
@ -127,6 +127,7 @@ rusty-enums = [
|
|||
"mozilla::StyleTextRendering",
|
||||
"mozilla::StyleColorAdjust",
|
||||
"mozilla::StyleFlexDirection",
|
||||
"mozilla::StyleFlexWrap",
|
||||
"mozilla::StyleTextDecorationSkipInk",
|
||||
"mozilla::StyleTextDecorationLength",
|
||||
"nsStyleImageType",
|
||||
|
|
|
@ -453,9 +453,11 @@ enum class StyleFlexDirection : uint8_t {
|
|||
};
|
||||
|
||||
// See nsStylePosition
|
||||
#define NS_STYLE_FLEX_WRAP_NOWRAP 0
|
||||
#define NS_STYLE_FLEX_WRAP_WRAP 1
|
||||
#define NS_STYLE_FLEX_WRAP_WRAP_REVERSE 2
|
||||
enum class StyleFlexWrap : uint8_t {
|
||||
Nowrap,
|
||||
Wrap,
|
||||
WrapReverse,
|
||||
};
|
||||
|
||||
// See nsStylePosition
|
||||
// NOTE: This is the initial value of the integer-valued 'order' property
|
||||
|
|
|
@ -1176,7 +1176,7 @@ nsStylePosition::nsStylePosition(const Document& aDocument)
|
|||
mJustifyItems(NS_STYLE_JUSTIFY_NORMAL),
|
||||
mJustifySelf(NS_STYLE_JUSTIFY_AUTO),
|
||||
mFlexDirection(StyleFlexDirection::Row),
|
||||
mFlexWrap(NS_STYLE_FLEX_WRAP_NOWRAP),
|
||||
mFlexWrap(StyleFlexWrap::Nowrap),
|
||||
mObjectFit(NS_STYLE_OBJECT_FIT_FILL),
|
||||
mOrder(NS_STYLE_ORDER_INITIAL),
|
||||
mFlexGrow(0.0f),
|
||||
|
|
|
@ -1033,7 +1033,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStylePosition {
|
|||
uint8_t mJustifyItems;
|
||||
uint8_t mJustifySelf;
|
||||
mozilla::StyleFlexDirection mFlexDirection;
|
||||
uint8_t mFlexWrap; // NS_STYLE_FLEX_WRAP_*
|
||||
mozilla::StyleFlexWrap mFlexWrap;
|
||||
uint8_t mObjectFit; // NS_STYLE_OBJECT_FIT_*
|
||||
int32_t mOrder;
|
||||
float mFlexGrow;
|
||||
|
|
|
@ -91,6 +91,7 @@ ${helpers.single_keyword(
|
|||
extra_prefixes="webkit",
|
||||
animation_value_type="discrete",
|
||||
servo_restyle_damage = "reflow",
|
||||
gecko_enum_prefix = "StyleFlexWrap",
|
||||
)}
|
||||
|
||||
% if engine == "servo-2013":
|
||||
|
|
Загрузка…
Ссылка в новой задаче