Bug 1600481 : convert NS_STYLE_ISOLATION_* to an enum class in nsStyleConsts.h r=emilio
authorjeffin143 <jeffinsam@karunya.edu.in>
Fri, 06 Dec 2019 04:42:18 +0000
changeset 567946 321a5b9fd6f4161ecf8748b57dd58728f894211a
parent 567945 a22c83382c801f86bfb724224db590bfb8961059
child 567947 b515b0637e5eaf851af4a5aa1f8668c02d1a38ab
push id12493
push userffxbld-merge
push dateMon, 06 Jan 2020 15:38:57 +0000
treeherdermozilla-beta@63ae456b848d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1600481
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1600481 : convert NS_STYLE_ISOLATION_* to an enum class in nsStyleConsts.h r=emilio Differential Revision: https://phabricator.services.mozilla.com/D55378
layout/generic/nsFrame.cpp
layout/style/ServoBindings.toml
layout/style/nsStyleConsts.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
servo/components/style/properties/longhands/box.mako.rs
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -10924,17 +10924,17 @@ bool nsIFrame::IsStackingContext(const n
          // but the spec says it acts like the rest of these
          ChildrenHavePerspective(aStyleDisplay) ||
          aStyleEffects->mMixBlendMode != NS_STYLE_BLEND_NORMAL ||
          nsSVGIntegrationUtils::UsingEffectsForFrame(this) ||
          (aIsPositioned && (aStyleDisplay->IsPositionForcingStackingContext() ||
                             aStylePosition->mZIndex.IsInteger())) ||
          (aStyleDisplay->mWillChange.bits &
           StyleWillChangeBits_STACKING_CONTEXT) ||
-         aStyleDisplay->mIsolation != NS_STYLE_ISOLATION_AUTO ||
+         aStyleDisplay->mIsolation != StyleIsolation::Auto ||
          aStyleEffects->HasBackdropFilters();
 }
 
 bool nsIFrame::IsStackingContext() {
   const nsStyleDisplay* disp = StyleDisplay();
   const bool isPositioned = disp->IsAbsPosContainingBlock(this);
   return IsStackingContext(disp, StylePosition(), StyleEffects(), isPositioned);
 }
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -134,16 +134,17 @@ rusty-enums = [
     "mozilla::StyleStrokeLinecap",
     "mozilla::StyleFlexWrap",
     "mozilla::StyleTextDecorationSkipInk",
     "mozilla::StyleTextDecorationLength",
     "mozilla::StyleShapeRendering",
     "mozilla::StyleTextAnchor",
     "mozilla::StyleObjectFit",
     "mozilla::StyleTopLayer",
+    "mozilla::StyleIsolation",
     "mozilla::StyleTextOrientation",
     "nsStyleImageType",
     "nsINode_BooleanFlag",
     "mozilla::PseudoStyleType",
     "mozilla::LookAndFeel_ColorID",
     "mozilla::LookAndFeel_FontID",
     "nsStyleTransformMatrix::MatrixTransformOperator",
     "mozilla::StyleGeometryBox",
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -574,19 +574,20 @@ enum class StyleGridTrackBreadth : uint8
 #define NS_STYLE_POINTER_EVENTS_VISIBLESTROKE 3
 #define NS_STYLE_POINTER_EVENTS_VISIBLE 4
 #define NS_STYLE_POINTER_EVENTS_PAINTED 5
 #define NS_STYLE_POINTER_EVENTS_FILL 6
 #define NS_STYLE_POINTER_EVENTS_STROKE 7
 #define NS_STYLE_POINTER_EVENTS_ALL 8
 #define NS_STYLE_POINTER_EVENTS_AUTO 9
 
-// See nsStyleDisplay
-#define NS_STYLE_ISOLATION_AUTO 0
-#define NS_STYLE_ISOLATION_ISOLATE 1
+enum class StyleIsolation : uint8_t {
+  Auto,
+  Isolate,
+};
 
 // See nsStylePosition.mObjectFit
 enum class StyleObjectFit : uint8_t {
   Fill,
   Contain,
   Cover,
   None,
   ScaleDown,
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2673,17 +2673,17 @@ nsStyleDisplay::nsStyleDisplay(const Doc
       mBreakBefore(StyleBreakBetween::Auto),
       mBreakAfter(StyleBreakBetween::Auto),
       mOverflowX(StyleOverflow::Visible),
       mOverflowY(StyleOverflow::Visible),
       mOverflowClipBoxBlock(StyleOverflowClipBox::PaddingBox),
       mOverflowClipBoxInline(StyleOverflowClipBox::PaddingBox),
       mResize(StyleResize::None),
       mOrient(StyleOrient::Inline),
-      mIsolation(NS_STYLE_ISOLATION_AUTO),
+      mIsolation(StyleIsolation::Auto),
       mTopLayer(StyleTopLayer::None),
       mTouchAction(StyleTouchAction_AUTO),
       mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO),
       mOverscrollBehaviorX(StyleOverscrollBehavior::Auto),
       mOverscrollBehaviorY(StyleOverscrollBehavior::Auto),
       mOverflowAnchor(StyleOverflowAnchor::Auto),
       mScrollSnapAlign{StyleScrollSnapAlignKeyword::None,
                        StyleScrollSnapAlignKeyword::None},
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1523,17 +1523,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   mozilla::StyleBreakBetween mBreakBefore;
   mozilla::StyleBreakBetween mBreakAfter;
   mozilla::StyleOverflow mOverflowX;
   mozilla::StyleOverflow mOverflowY;
   mozilla::StyleOverflowClipBox mOverflowClipBoxBlock;
   mozilla::StyleOverflowClipBox mOverflowClipBoxInline;
   mozilla::StyleResize mResize;
   mozilla::StyleOrient mOrient;
-  uint8_t mIsolation;  // NS_STYLE_ISOLATION_*
+  mozilla::StyleIsolation mIsolation;
   mozilla::StyleTopLayer mTopLayer;
 
   mozilla::StyleTouchAction mTouchAction;
   uint8_t mScrollBehavior;  // NS_STYLE_SCROLL_BEHAVIOR_*
   mozilla::StyleOverscrollBehavior mOverscrollBehaviorX;
   mozilla::StyleOverscrollBehavior mOverscrollBehaviorY;
   mozilla::StyleOverflowAnchor mOverflowAnchor;
   mozilla::StyleScrollSnapAlign mScrollSnapAlign;
--- a/servo/components/style/properties/longhands/box.mako.rs
+++ b/servo/components/style/properties/longhands/box.mako.rs
@@ -486,16 +486,17 @@ impl computed_value::T {
 // Compositing and Blending Level 1
 // http://www.w3.org/TR/compositing-1/
 ${helpers.single_keyword(
     "isolation",
     "auto isolate",
     engines="gecko",
     spec="https://drafts.fxtf.org/compositing/#isolation",
     flags="CREATES_STACKING_CONTEXT",
+    gecko_enum_prefix="StyleIsolation",
     animation_value_type="discrete",
 )}
 
 ${helpers.predefined_type(
     "break-after",
     "BreakBetween",
     "computed::BreakBetween::Auto",
     engines="gecko",