Bug 1512328 - Use cbindgen for a couple more CSS properties. r=jwatt
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 05 Dec 2018 18:04:51 -0500
changeset 449666 d4f6a34f0d1ceb00f224c818cedc132dfe4b2582
parent 449665 f228599d59928ea559e3acadcc7f3b0803f53c6c
child 449667 b2eb9000daed2a2cff623eae8ca2387bb59e4601
push idunknown
push userunknown
push dateunknown
reviewersjwatt
bugs1512328
milestone65.0a1
Bug 1512328 - Use cbindgen for a couple more CSS properties. r=jwatt Differential Revision: https://phabricator.services.mozilla.com/D13886
gfx/layers/FrameMetrics.h
gfx/layers/apz/test/gtest/TestSnapping.cpp
gfx/layers/ipc/LayersMessageUtils.h
layout/base/PresShell.cpp
layout/base/ScrollStyles.h
layout/base/nsPresContext.cpp
layout/generic/ScrollSnap.cpp
layout/generic/nsFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/style/ServoBindings.toml
layout/style/ServoCSSPropList.mako.py
layout/style/nsCSSKeywordList.h
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsComputedDOMStyle.h
layout/style/nsStyleConsts.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
servo/components/style/cbindgen.toml
servo/components/style/properties/gecko.mako.rs
servo/components/style/properties/longhands/box.mako.rs
servo/components/style/values/computed/box.rs
servo/components/style/values/specified/box.rs
--- a/gfx/layers/FrameMetrics.h
+++ b/gfx/layers/FrameMetrics.h
@@ -677,38 +677,37 @@ struct FrameMetrics {
   //
   // Please add new fields above this comment.
 
   // Private helpers for IPC purposes
   void SetDoSmoothScroll(bool aValue) { mDoSmoothScroll = aValue; }
 };
 
 struct ScrollSnapInfo {
-  ScrollSnapInfo()
-      : mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
-        mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE) {}
+  ScrollSnapInfo() = default;
 
   bool operator==(const ScrollSnapInfo& aOther) const {
     return mScrollSnapTypeX == aOther.mScrollSnapTypeX &&
            mScrollSnapTypeY == aOther.mScrollSnapTypeY &&
            mScrollSnapIntervalX == aOther.mScrollSnapIntervalX &&
            mScrollSnapIntervalY == aOther.mScrollSnapIntervalY &&
            mScrollSnapDestination == aOther.mScrollSnapDestination &&
            mScrollSnapCoordinates == aOther.mScrollSnapCoordinates;
   }
 
   bool HasScrollSnapping() const {
-    return mScrollSnapTypeY != NS_STYLE_SCROLL_SNAP_TYPE_NONE ||
-           mScrollSnapTypeX != NS_STYLE_SCROLL_SNAP_TYPE_NONE;
+    return mScrollSnapTypeY != mozilla::StyleScrollSnapType::None ||
+           mScrollSnapTypeX != mozilla::StyleScrollSnapType::None;
   }
 
   // The scroll frame's scroll-snap-type.
-  // One of NS_STYLE_SCROLL_SNAP_{NONE, MANDATORY, PROXIMITY}.
-  uint8_t mScrollSnapTypeX;
-  uint8_t mScrollSnapTypeY;
+  mozilla::StyleScrollSnapType mScrollSnapTypeX =
+      mozilla::StyleScrollSnapType::None;
+  mozilla::StyleScrollSnapType mScrollSnapTypeY =
+      mozilla::StyleScrollSnapType::None;
 
   // The intervals derived from the scroll frame's scroll-snap-points.
   Maybe<nscoord> mScrollSnapIntervalX;
   Maybe<nscoord> mScrollSnapIntervalY;
 
   // The scroll frame's scroll-snap-destination, in cooked form (to avoid
   // shipping the raw nsStyleCoord::CalcValue over IPC).
   nsPoint mScrollSnapDestination;
--- a/gfx/layers/apz/test/gtest/TestSnapping.cpp
+++ b/gfx/layers/apz/test/gtest/TestSnapping.cpp
@@ -21,17 +21,17 @@ TEST_F(APZCSnappingTester, Bug1265510) {
       CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
   SetScrollableFrameMetrics(root, ScrollableLayerGuid::START_SCROLL_ID,
                             CSSRect(0, 0, 100, 200));
   SetScrollableFrameMetrics(layers[1], ScrollableLayerGuid::START_SCROLL_ID + 1,
                             CSSRect(0, 0, 100, 200));
   SetScrollHandoff(layers[1], root);
 
   ScrollSnapInfo snap;
-  snap.mScrollSnapTypeY = NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY;
+  snap.mScrollSnapTypeY = StyleScrollSnapType::Mandatory;
   snap.mScrollSnapIntervalY = Some(100 * AppUnitsPerCSSPixel());
 
   ScrollMetadata metadata = root->GetScrollMetadata(0);
   metadata.SetSnapInfo(ScrollSnapInfo(snap));
   root->SetScrollMetadata(metadata);
 
   UniquePtr<ScopedLayerTreeRegistration> registration =
       MakeUnique<ScopedLayerTreeRegistration>(manager, LayersId{0}, root, mcc);
@@ -91,17 +91,17 @@ TEST_F(APZCSnappingTester, Snap_After_Pi
   };
   root =
       CreateLayerTree(layerTreeSyntax, layerVisibleRegion, nullptr, lm, layers);
   SetScrollableFrameMetrics(root, ScrollableLayerGuid::START_SCROLL_ID,
                             CSSRect(0, 0, 100, 200));
 
   // Set up some basic scroll snapping
   ScrollSnapInfo snap;
-  snap.mScrollSnapTypeY = NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY;
+  snap.mScrollSnapTypeY = StyleScrollSnapType::Mandatory;
   snap.mScrollSnapIntervalY = Some(100 * AppUnitsPerCSSPixel());
 
   // Save the scroll snap info on the root APZC.
   // Also mark the root APZC as "root content", since APZC only allows
   // zooming on the root content APZC.
   ScrollMetadata metadata = root->GetScrollMetadata(0);
   metadata.SetSnapInfo(ScrollSnapInfo(snap));
   metadata.GetMetrics().SetIsRootContent(true);
--- a/gfx/layers/ipc/LayersMessageUtils.h
+++ b/gfx/layers/ipc/LayersMessageUtils.h
@@ -55,16 +55,22 @@ struct ParamTraits<mozilla::layers::Laye
 
 template <>
 struct ParamTraits<mozilla::layers::ScaleMode>
     : public ContiguousEnumSerializerInclusive<
           mozilla::layers::ScaleMode, mozilla::layers::ScaleMode::SCALE_NONE,
           mozilla::layers::kHighestScaleMode> {};
 
 template <>
+struct ParamTraits<mozilla::StyleScrollSnapType>
+    : public ContiguousEnumSerializerInclusive<
+          mozilla::StyleScrollSnapType, mozilla::StyleScrollSnapType::None,
+          mozilla::StyleScrollSnapType::Proximity> {};
+
+template <>
 struct ParamTraits<mozilla::layers::TextureFlags>
     : public BitFlagsEnumSerializer<mozilla::layers::TextureFlags,
                                     mozilla::layers::TextureFlags::ALL_BITS> {};
 
 template <>
 struct ParamTraits<mozilla::layers::DiagnosticTypes>
     : public BitFlagsEnumSerializer<
           mozilla::layers::DiagnosticTypes,
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -3434,27 +3434,25 @@ bool PresShell::ScrollFrameRectIntoView(
   do {
     nsIScrollableFrame* sf = do_QueryFrame(container);
     if (sf) {
       nsPoint oldPosition = sf->GetScrollPosition();
       nsRect targetRect = rect;
       // Inflate the scrolled rect by the container's padding in each dimension,
       // unless we have 'overflow-clip-box-*: content-box' in that dimension.
       auto* disp = container->StyleDisplay();
-      if (disp->mOverflowClipBoxBlock ==
-              NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX ||
-          disp->mOverflowClipBoxInline ==
-              NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX) {
+      if (disp->mOverflowClipBoxBlock == StyleOverflowClipBox::ContentBox ||
+          disp->mOverflowClipBoxInline == StyleOverflowClipBox::ContentBox) {
         WritingMode wm = container->GetWritingMode();
         bool cbH = (wm.IsVertical() ? disp->mOverflowClipBoxBlock
                                     : disp->mOverflowClipBoxInline) ==
-                   NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX;
+                   StyleOverflowClipBox::ContentBox;
         bool cbV = (wm.IsVertical() ? disp->mOverflowClipBoxInline
                                     : disp->mOverflowClipBoxBlock) ==
-                   NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX;
+                   StyleOverflowClipBox::ContentBox;
         nsMargin padding = container->GetUsedPadding();
         if (!cbH) {
           padding.left = padding.right = nscoord(0);
         }
         if (!cbV) {
           padding.top = padding.bottom = nscoord(0);
         }
         targetRect.Inflate(padding);
--- a/layout/base/ScrollStyles.h
+++ b/layout/base/ScrollStyles.h
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_ScrollStyles_h
 #define mozilla_ScrollStyles_h
 
 #include <stdint.h>
-#include "nsStyleConsts.h"  // for NS_STYLE_SCROLL_SNAP_*
+#include "nsStyleConsts.h"
 #include "nsStyleCoord.h"   // for nsStyleCoord
 #include "mozilla/dom/WindowBinding.h"
 
 // Forward declarations
 struct nsStyleDisplay;
 
 namespace mozilla {
 
@@ -22,33 +22,31 @@ struct ScrollStyles {
   // or NS_STYLE_OVERFLOW_AUTO.
   uint8_t mHorizontal;
   uint8_t mVertical;
   // Always one of NS_STYLE_SCROLL_BEHAVIOR_AUTO or
   // NS_STYLE_SCROLL_BEHAVIOR_SMOOTH
   uint8_t mScrollBehavior;
   mozilla::StyleOverscrollBehavior mOverscrollBehaviorX;
   mozilla::StyleOverscrollBehavior mOverscrollBehaviorY;
-  // Always one of NS_STYLE_SCROLL_SNAP_NONE, NS_STYLE_SCROLL_SNAP_MANDATORY,
-  // or NS_STYLE_SCROLL_SNAP_PROXIMITY.
-  uint8_t mScrollSnapTypeX;
-  uint8_t mScrollSnapTypeY;
+  mozilla::StyleScrollSnapType mScrollSnapTypeX;
+  mozilla::StyleScrollSnapType mScrollSnapTypeY;
   nsStyleCoord mScrollSnapPointsX;
   nsStyleCoord mScrollSnapPointsY;
   nsStyleCoord::CalcValue mScrollSnapDestinationX;
   nsStyleCoord::CalcValue mScrollSnapDestinationY;
 
   ScrollStyles(uint8_t aH, uint8_t aV)
       : mHorizontal(aH),
         mVertical(aV),
         mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO),
         mOverscrollBehaviorX(StyleOverscrollBehavior::Auto),
         mOverscrollBehaviorY(StyleOverscrollBehavior::Auto),
-        mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
-        mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
+        mScrollSnapTypeX(mozilla::StyleScrollSnapType::None),
+        mScrollSnapTypeY(mozilla::StyleScrollSnapType::None),
         mScrollSnapPointsX(nsStyleCoord(eStyleUnit_None)),
         mScrollSnapPointsY(nsStyleCoord(eStyleUnit_None)) {
     mScrollSnapDestinationX.mPercent = 0;
     mScrollSnapDestinationX.mLength = nscoord(0.0f);
     mScrollSnapDestinationX.mHasPercent = false;
     mScrollSnapDestinationY.mPercent = 0;
     mScrollSnapDestinationY.mLength = nscoord(0.0f);
     mScrollSnapDestinationY.mHasPercent = false;
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1239,18 +1239,18 @@ gfxSize nsPresContext::ScreenSizeInchesF
 }
 
 static bool CheckOverflow(const nsStyleDisplay* aDisplay,
                           ScrollStyles* aStyles) {
   if (aDisplay->mOverflowX == NS_STYLE_OVERFLOW_VISIBLE &&
       aDisplay->mScrollBehavior == NS_STYLE_SCROLL_BEHAVIOR_AUTO &&
       aDisplay->mOverscrollBehaviorX == StyleOverscrollBehavior::Auto &&
       aDisplay->mOverscrollBehaviorY == StyleOverscrollBehavior::Auto &&
-      aDisplay->mScrollSnapTypeX == NS_STYLE_SCROLL_SNAP_TYPE_NONE &&
-      aDisplay->mScrollSnapTypeY == NS_STYLE_SCROLL_SNAP_TYPE_NONE &&
+      aDisplay->mScrollSnapTypeX == StyleScrollSnapType::None &&
+      aDisplay->mScrollSnapTypeY == StyleScrollSnapType::None &&
       aDisplay->mScrollSnapPointsX == nsStyleCoord(eStyleUnit_None) &&
       aDisplay->mScrollSnapPointsY == nsStyleCoord(eStyleUnit_None) &&
       !aDisplay->mScrollSnapDestination.mXPosition.mHasPercent &&
       !aDisplay->mScrollSnapDestination.mYPosition.mHasPercent &&
       aDisplay->mScrollSnapDestination.mXPosition.mLength == 0 &&
       aDisplay->mScrollSnapDestination.mYPosition.mLength == 0) {
     return false;
   }
--- a/layout/generic/ScrollSnap.cpp
+++ b/layout/generic/ScrollSnap.cpp
@@ -54,17 +54,17 @@ class CalcSnapPoints : public SnappingEd
                        nscoord aScrollingDirection, nscoord* aBestEdge,
                        bool* aEdgeFound);
   nsPoint GetBestEdge() const;
 
  protected:
   nsIScrollableFrame::ScrollUnit mUnit;
   nsPoint mDestination;  // gives the position after scrolling but before
                          // snapping
-  nsPoint mStartPos;  // gives the position before scrolling
+  nsPoint mStartPos;     // gives the position before scrolling
   nsIntPoint mScrollingDirection;  // always -1, 0, or 1
   nsPoint mBestEdge;  // keeps track of the position of the current best edge
   bool mHorizontalEdgeFound;  // true if mBestEdge.x is storing a valid
                               // horizontal edge
   bool mVerticalEdgeFound;    // true if mBestEdge.y is storing a valid vertical
                               // edge
 };
 
@@ -247,18 +247,18 @@ static void ProcessScrollSnapCoordinates
     aCallback.AddHorizontalEdge(snapCoords.y);
   }
 }
 
 Maybe<nsPoint> ScrollSnapUtils::GetSnapPointForDestination(
     const ScrollSnapInfo& aSnapInfo, nsIScrollableFrame::ScrollUnit aUnit,
     const nsSize& aScrollPortSize, const nsRect& aScrollRange,
     const nsPoint& aStartPos, const nsPoint& aDestination) {
-  if (aSnapInfo.mScrollSnapTypeY == NS_STYLE_SCROLL_SNAP_TYPE_NONE &&
-      aSnapInfo.mScrollSnapTypeX == NS_STYLE_SCROLL_SNAP_TYPE_NONE) {
+  if (aSnapInfo.mScrollSnapTypeY == StyleScrollSnapType::None &&
+      aSnapInfo.mScrollSnapTypeX == StyleScrollSnapType::None) {
     return Nothing();
   }
 
   nsPoint destPos = aSnapInfo.mScrollSnapDestination;
 
   CalcSnapPoints calcSnapPoints(aUnit, aDestination, aStartPos);
 
   if (aSnapInfo.mScrollSnapIntervalX.isSome()) {
@@ -271,23 +271,23 @@ Maybe<nsPoint> ScrollSnapUtils::GetSnapP
   }
 
   ProcessScrollSnapCoordinates(calcSnapPoints, aSnapInfo.mScrollSnapCoordinates,
                                destPos);
   bool snapped = false;
   nsPoint finalPos = calcSnapPoints.GetBestEdge();
   nscoord proximityThreshold = gfxPrefs::ScrollSnapProximityThreshold();
   proximityThreshold = nsPresContext::CSSPixelsToAppUnits(proximityThreshold);
-  if (aSnapInfo.mScrollSnapTypeY == NS_STYLE_SCROLL_SNAP_TYPE_PROXIMITY &&
+  if (aSnapInfo.mScrollSnapTypeY == StyleScrollSnapType::Proximity &&
       std::abs(aDestination.y - finalPos.y) > proximityThreshold) {
     finalPos.y = aDestination.y;
   } else {
     snapped = true;
   }
-  if (aSnapInfo.mScrollSnapTypeX == NS_STYLE_SCROLL_SNAP_TYPE_PROXIMITY &&
+  if (aSnapInfo.mScrollSnapTypeX == StyleScrollSnapType::Proximity &&
       std::abs(aDestination.x - finalPos.x) > proximityThreshold) {
     finalPos.x = aDestination.x;
   } else {
     snapped = true;
   }
   return snapped ? Some(finalPos) : Nothing();
 }
 
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -2317,20 +2317,20 @@ static bool ApplyOverflowClipping(
   nsRect clipRect;
   bool haveRadii = false;
   nscoord radii[8];
   auto* disp = aFrame->StyleDisplay();
   // Only deflate the padding if we clip to the content-box in that axis.
   auto wm = aFrame->GetWritingMode();
   bool cbH = (wm.IsVertical() ? disp->mOverflowClipBoxBlock
                               : disp->mOverflowClipBoxInline) ==
-             NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX;
+             StyleOverflowClipBox::ContentBox;
   bool cbV = (wm.IsVertical() ? disp->mOverflowClipBoxInline
                               : disp->mOverflowClipBoxBlock) ==
-             NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX;
+             StyleOverflowClipBox::ContentBox;
   nsMargin bp = aFrame->GetUsedPadding();
   if (!cbH) {
     bp.left = bp.right = nscoord(0);
   }
   if (!cbV) {
     bp.top = bp.bottom = nscoord(0);
   }
 
@@ -7337,19 +7337,17 @@ void nsIFrame::RootFrameList(nsPresConte
     nsIFrame* frame = shell->GetRootFrame();
     if (frame) {
       frame->List(out, aPrefix);
     }
   }
 }
 #endif
 
-bool nsIFrame::IsVisibleForPainting() {
-  return StyleVisibility()->IsVisible();
-}
+bool nsIFrame::IsVisibleForPainting() { return StyleVisibility()->IsVisible(); }
 
 bool nsIFrame::IsVisibleOrCollapsedForPainting() {
   return StyleVisibility()->IsVisibleOrCollapsed();
 }
 
 /* virtual */ bool nsFrame::IsEmpty() { return false; }
 
 bool nsIFrame::CachedIsEmpty() {
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -591,29 +591,27 @@ void nsHTMLScrollFrame::ReflowScrolledFr
   // should always set mOverflowArea. In fact nsPluginFrame and nsFrameFrame
   // don't support the 'outline' property because of this. Rather than fix the
   // world right now, just fix up the overflow area if necessary. Note that we
   // don't check HasOverflowRect() because it could be set even though the
   // overflow area doesn't include the frame bounds.
   aMetrics->UnionOverflowAreasWithDesiredBounds();
 
   auto* disp = StyleDisplay();
-  if (MOZ_UNLIKELY(disp->mOverflowClipBoxBlock ==
-                       NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX ||
-                   disp->mOverflowClipBoxInline ==
-                       NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX)) {
+  if (MOZ_UNLIKELY(
+          disp->mOverflowClipBoxBlock == StyleOverflowClipBox::ContentBox ||
+          disp->mOverflowClipBoxInline == StyleOverflowClipBox::ContentBox)) {
     nsOverflowAreas childOverflow;
     nsLayoutUtils::UnionChildOverflow(mHelper.mScrolledFrame, childOverflow);
     nsRect childScrollableOverflow = childOverflow.ScrollableOverflow();
-    if (disp->mOverflowClipBoxBlock == NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX) {
+    if (disp->mOverflowClipBoxBlock == StyleOverflowClipBox::PaddingBox) {
       padding.BStart(wm) = nscoord(0);
       padding.BEnd(wm) = nscoord(0);
     }
-    if (disp->mOverflowClipBoxInline ==
-        NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX) {
+    if (disp->mOverflowClipBoxInline == StyleOverflowClipBox::PaddingBox) {
       padding.IStart(wm) = nscoord(0);
       padding.IEnd(wm) = nscoord(0);
     }
     childScrollableOverflow.Inflate(padding.GetPhysicalMargin(wm));
     nsRect contentArea = wm.IsVertical()
                              ? nsRect(0, 0, computedBSize, availISize)
                              : nsRect(0, 0, availISize, computedBSize);
     if (!contentArea.Contains(childScrollableOverflow)) {
@@ -3358,27 +3356,26 @@ void ScrollFrameHelper::BuildDisplayList
   if (disp && (disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_SCROLL)) {
     aBuilder->AddToWillChangeBudget(mOuter, GetVisualViewportSize());
   }
 
   mScrollParentID = aBuilder->GetCurrentScrollParentId();
 
   Maybe<nsRect> contentBoxClip;
   Maybe<const DisplayItemClipChain*> extraContentBoxClipForNonCaretContent;
-  if (MOZ_UNLIKELY(disp->mOverflowClipBoxBlock ==
-                       NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX ||
-                   disp->mOverflowClipBoxInline ==
-                       NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX)) {
+  if (MOZ_UNLIKELY(
+          disp->mOverflowClipBoxBlock == StyleOverflowClipBox::ContentBox ||
+          disp->mOverflowClipBoxInline == StyleOverflowClipBox::ContentBox)) {
     WritingMode wm = mScrolledFrame->GetWritingMode();
     bool cbH = (wm.IsVertical() ? disp->mOverflowClipBoxBlock
                                 : disp->mOverflowClipBoxInline) ==
-               NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX;
+               StyleOverflowClipBox::ContentBox;
     bool cbV = (wm.IsVertical() ? disp->mOverflowClipBoxInline
                                 : disp->mOverflowClipBoxBlock) ==
-               NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX;
+               StyleOverflowClipBox::ContentBox;
     // We only clip if there is *scrollable* overflow, to avoid clipping
     // *visual* overflow unnecessarily.
     nsRect clipRect = mScrollPort + aBuilder->ToReferenceFrame(mOuter);
     nsRect so = mScrolledFrame->GetScrollableOverflowRect();
     if ((cbH && (clipRect.width != so.width || so.x < 0)) ||
         (cbV && (clipRect.height != so.height || so.y < 0))) {
       nsMargin padding = mOuter->GetUsedPadding();
       if (!cbH) {
@@ -4070,18 +4067,18 @@ void ScrollFrameHelper::ScrollBy(nsIntPo
       return;
   }
 
   nsPoint newPos = mDestination + nsPoint(aDelta.x * deltaMultiplier.width,
                                           aDelta.y * deltaMultiplier.height);
 
   if (aSnap == nsIScrollableFrame::ENABLE_SNAP) {
     ScrollStyles styles = GetScrollStylesFromFrame();
-    if (styles.mScrollSnapTypeY != NS_STYLE_SCROLL_SNAP_TYPE_NONE ||
-        styles.mScrollSnapTypeX != NS_STYLE_SCROLL_SNAP_TYPE_NONE) {
+    if (styles.mScrollSnapTypeY != StyleScrollSnapType::None ||
+        styles.mScrollSnapTypeX != StyleScrollSnapType::None) {
       nscoord appUnitsPerDevPixel =
           mOuter->PresContext()->AppUnitsPerDevPixel();
       deltaMultiplier = nsSize(appUnitsPerDevPixel, appUnitsPerDevPixel);
       negativeTolerance = 0.1f;
       positiveTolerance = 0;
       nsIScrollableFrame::ScrollUnit snapUnit = aUnit;
       if (aOrigin == nsGkAtoms::mouseWheel) {
         // When using a clicky scroll wheel, snap point selection works the same
@@ -4516,18 +4513,18 @@ nsresult ScrollFrameHelper::CreateAnonym
 
   // Check if the frame is resizable. Note:
   // "The effect of the resize property on generated content is undefined.
   //  Implementations should not apply the resize property to generated
   //  content." [1]
   // For info on what is generated content, see [2].
   // [1]: https://drafts.csswg.org/css-ui/#resize
   // [2]: https://www.w3.org/TR/CSS2/generate.html#content
-  int8_t resizeStyle = mOuter->StyleDisplay()->mResize;
-  bool isResizable = resizeStyle != NS_STYLE_RESIZE_NONE &&
+  auto resizeStyle = mOuter->StyleDisplay()->mResize;
+  bool isResizable = resizeStyle != StyleResize::None &&
                      !mOuter->HasAnyStateBits(NS_FRAME_GENERATED_CONTENT);
 
   nsIScrollableFrame* scrollable = do_QueryFrame(mOuter);
 
   // If we're the scrollframe for the root, then we want to construct
   // our scrollbar frames no matter what.  That way later dynamic
   // changes to propagated overflow styles will show or hide
   // scrollbars on the viewport without requiring frame reconstruction
@@ -4620,31 +4617,31 @@ nsresult ScrollFrameHelper::CreateAnonym
     nodeInfo = nodeInfoManager->GetNodeInfo(
         nsGkAtoms::resizer, nullptr, kNameSpaceID_XUL, nsINode::ELEMENT_NODE);
     NS_ENSURE_TRUE(nodeInfo, NS_ERROR_OUT_OF_MEMORY);
 
     NS_TrustedNewXULElement(getter_AddRefs(mResizerContent), nodeInfo.forget());
 
     nsAutoString dir;
     switch (resizeStyle) {
-      case NS_STYLE_RESIZE_HORIZONTAL:
+      case StyleResize::Horizontal:
         if (IsScrollbarOnRight()) {
           dir.AssignLiteral("right");
         } else {
           dir.AssignLiteral("left");
         }
         break;
-      case NS_STYLE_RESIZE_VERTICAL:
+      case StyleResize::Vertical:
         dir.AssignLiteral("bottom");
         if (!IsScrollbarOnRight()) {
           mResizerContent->SetAttr(kNameSpaceID_None, nsGkAtoms::flip,
                                    EmptyString(), false);
         }
         break;
-      case NS_STYLE_RESIZE_BOTH:
+      case StyleResize::Both:
         if (IsScrollbarOnRight()) {
           dir.AssignLiteral("bottomright");
         } else {
           dir.AssignLiteral("bottomleft");
         }
         break;
       default:
         NS_WARNING("only resizable types should have resizers");
@@ -6246,18 +6243,18 @@ static void CollectScrollSnapCoordinates
 }
 
 static layers::ScrollSnapInfo ComputeScrollSnapInfo(
     const ScrollFrameHelper& aScrollFrame) {
   ScrollSnapInfo result;
 
   ScrollStyles styles = aScrollFrame.GetScrollStylesFromFrame();
 
-  if (styles.mScrollSnapTypeY == NS_STYLE_SCROLL_SNAP_TYPE_NONE &&
-      styles.mScrollSnapTypeX == NS_STYLE_SCROLL_SNAP_TYPE_NONE) {
+  if (styles.mScrollSnapTypeY == StyleScrollSnapType::None &&
+      styles.mScrollSnapTypeX == StyleScrollSnapType::None) {
     // We won't be snapping, short-circuit the computation.
     return result;
   }
 
   result.mScrollSnapTypeX = styles.mScrollSnapTypeX;
   result.mScrollSnapTypeY = styles.mScrollSnapTypeY;
 
   nsSize scrollPortSize = aScrollFrame.GetScrollPortRect().Size();
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -398,16 +398,22 @@ cbindgen-types = [
     { gecko = "StylePathCommand", servo = "values::specified::svg_path::PathCommand" },
     { gecko = "StyleUnicodeRange", servo = "cssparser::UnicodeRange" },
     { gecko = "StyleOverflowWrap", servo = "values::computed::OverflowWrap" },
     { gecko = "StyleUserSelect", servo = "values::computed::UserSelect" },
     { gecko = "StyleBreakBetween", servo = "values::computed::BreakBetween" },
     { gecko = "StyleBreakWithin", servo = "values::computed::BreakWithin" },
     { gecko = "StyleBorderStyle", servo = "values::computed::BorderStyle" },
     { gecko = "StyleOutlineStyle", servo = "values::computed::OutlineStyle" },
+    { gecko = "StyleScrollSnapType", servo = "values::computed::ScrollSnapType" },
+    { gecko = "StyleResize", servo = "values::computed::Resize" },
+    { gecko = "StyleOverflowClipBox", servo = "values::computed::OverflowClipBox" },
+    { gecko = "StyleFloat", servo = "values::computed::Float" },
+    { gecko = "StyleOverscrollBehavior", servo = "values::computed::OverscrollBehavior" },
+    { gecko = "StyleTextAlign", servo = "values::computed::TextAlign" },
 ]
 
 mapped-generic-types = [
     { generic = true, gecko = "mozilla::RustCell", servo = "::std::cell::Cell" },
     { generic = false, gecko = "ServoNodeData", servo = "AtomicRefCell<ElementData>" },
     { generic = false, gecko = "mozilla::ServoWritingMode", servo = "::logical_geometry::WritingMode" },
     { generic = false, gecko = "mozilla::ServoCustomPropertiesMap", servo = "Option<::servo_arc::Arc<::custom_properties::CustomPropertiesMap>>" },
     { generic = false, gecko = "mozilla::ServoRuleNode", servo = "Option<::rule_tree::StrongRuleNode>" },
--- a/layout/style/ServoCSSPropList.mako.py
+++ b/layout/style/ServoCSSPropList.mako.py
@@ -118,16 +118,21 @@ SERIALIZED_PREDEFINED_TYPES = [
     "TransformStyle",
     "UserSelect",
     "background::BackgroundSize",
     "basic_shape::ClippingShape",
     "basic_shape::FloatAreaShape",
     "position::HorizontalPosition",
     "position::VerticalPosition",
     "url::ImageUrlOrNone",
+    "Appearance",
+    "OverscrollBehavior",
+    "OverflowClipBox",
+    "ScrollSnapType",
+    "Float",
 ]
 
 def serialized_by_servo(prop):
     # If the property requires layout information, no such luck.
     if "GETCS_NEEDS_LAYOUT_FLUSH" in prop.flags:
         return False
     if prop.type() == "shorthand":
         # FIXME: Need to serialize a value interpolated with currentcolor
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -54,19 +54,16 @@ CSS_KEY(-moz-inline-grid, _moz_inline_gr
 CSS_KEY(-moz-inline-stack, _moz_inline_stack)
 CSS_KEY(-moz-left, _moz_left)
 CSS_KEY(-moz-max-content, _moz_max_content)
 CSS_KEY(-moz-middle-with-baseline, _moz_middle_with_baseline)
 CSS_KEY(-moz-min-content, _moz_min_content)
 CSS_KEY(-moz-none, _moz_none)
 CSS_KEY(-moz-popup, _moz_popup)
 CSS_KEY(-moz-right, _moz_right)
-CSS_KEY(-moz-scrollbars-horizontal, _moz_scrollbars_horizontal)
-CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none)
-CSS_KEY(-moz-scrollbars-vertical, _moz_scrollbars_vertical)
 CSS_KEY(-moz-stack, _moz_stack)
 CSS_KEY(-moz-zoom-in, _moz_zoom_in)
 CSS_KEY(-moz-zoom-out, _moz_zoom_out)
 CSS_KEY(-webkit-box, _webkit_box)
 CSS_KEY(-webkit-flex, _webkit_flex)
 CSS_KEY(-webkit-inline-box, _webkit_inline_box)
 CSS_KEY(-webkit-inline-flex, _webkit_inline_flex)
 CSS_KEY(alias, alias)
@@ -81,19 +78,17 @@ CSS_KEY(bottom, bottom)
 CSS_KEY(brightness, brightness)
 CSS_KEY(cell, cell)
 CSS_KEY(center, center)
 CSS_KEY(circle, circle)
 CSS_KEY(clip, clip)
 CSS_KEY(closest-side, closest_side)
 CSS_KEY(col-resize, col_resize)
 CSS_KEY(column, column)
-CSS_KEY(contain, contain)
 CSS_KEY(content, content)
-CSS_KEY(content-box, content_box)
 CSS_KEY(contents, contents)
 CSS_KEY(context-fill, context_fill)
 CSS_KEY(context-menu, context_menu)
 CSS_KEY(context-stroke, context_stroke)
 CSS_KEY(contrast, contrast)
 CSS_KEY(copy, copy)
 CSS_KEY(crosshair, crosshair)
 CSS_KEY(dashed, dashed)
@@ -115,17 +110,16 @@ CSS_KEY(filled, filled)
 CSS_KEY(flex, flex)
 CSS_KEY(flex-end, flex_end)
 CSS_KEY(flex-start, flex_start)
 CSS_KEY(flow-root, flow_root)
 CSS_KEY(grab, grab)
 CSS_KEY(grabbing, grabbing)
 CSS_KEY(grayscale, grayscale)
 CSS_KEY(grid, grid)
-CSS_KEY(groove, groove)
 CSS_KEY(help, help)
 CSS_KEY(hidden, hidden)
 CSS_KEY(hue-rotate, hue_rotate)
 CSS_KEY(infinite, infinite)
 CSS_KEY(inline, inline)
 CSS_KEY(inline-block, inline_block)
 CSS_KEY(inline-flex, inline_flex)
 CSS_KEY(inline-grid, inline_grid)
@@ -136,17 +130,16 @@ CSS_KEY(accumulatematrix, accumulatematr
 CSS_KEY(invert, invert)
 CSS_KEY(justify, justify)
 CSS_KEY(last baseline, last_baseline) // only used for DevTools auto-completion
 CSS_KEY(layout, layout)
 CSS_KEY(left, left)
 CSS_KEY(legacy, legacy)
 CSS_KEY(line-through, line_through)
 CSS_KEY(list-item, list_item)
-CSS_KEY(mandatory, mandatory)
 CSS_KEY(manipulation, manipulation)
 CSS_KEY(matrix, matrix)
 CSS_KEY(matrix3d, matrix3d)
 CSS_KEY(max-content, max_content)
 CSS_KEY(middle, middle)
 CSS_KEY(min-content, min_content)
 CSS_KEY(move, move)
 CSS_KEY(n-resize, n_resize)
@@ -156,29 +149,25 @@ CSS_KEY(no-drop, no_drop)
 CSS_KEY(none, none)
 CSS_KEY(normal, normal)
 CSS_KEY(not-allowed, not_allowed)
 CSS_KEY(ns-resize, ns_resize)
 CSS_KEY(nw-resize, nw_resize)
 CSS_KEY(nwse-resize, nwse_resize)
 CSS_KEY(opacity, opacity)
 CSS_KEY(open, open)
-CSS_KEY(outset, outset)
 CSS_KEY(over, over)
 CSS_KEY(overline, overline)
 CSS_KEY(paint, paint)
-CSS_KEY(padding-box, padding_box)
 CSS_KEY(pan-x, pan_x)
 CSS_KEY(pan-y, pan_y)
 CSS_KEY(perspective, perspective)
 CSS_KEY(pointer, pointer)
 CSS_KEY(polygon, polygon)
 CSS_KEY(progress, progress)
-CSS_KEY(proximity, proximity)
-CSS_KEY(ridge, ridge)
 CSS_KEY(right, right)
 CSS_KEY(rotate, rotate)
 CSS_KEY(rotate3d, rotate3d)
 CSS_KEY(rotatex, rotatex)
 CSS_KEY(rotatey, rotatey)
 CSS_KEY(rotatez, rotatez)
 CSS_KEY(row, row)
 CSS_KEY(row-resize, row_resize)
@@ -200,17 +189,16 @@ CSS_KEY(se-resize, se_resize)
 CSS_KEY(self-end, self_end)
 CSS_KEY(self-start, self_start)
 CSS_KEY(sepia, sepia)
 CSS_KEY(sesame, sesame)
 CSS_KEY(size, size)
 CSS_KEY(skew, skew)
 CSS_KEY(skewx, skewx)
 CSS_KEY(skewy, skewy)
-CSS_KEY(small-caps, small_caps)
 CSS_KEY(solid, solid)
 CSS_KEY(space-around, space_around)
 CSS_KEY(space-between, space_between)
 CSS_KEY(space-evenly, space_evenly)
 CSS_KEY(span, span)
 CSS_KEY(start, start)
 CSS_KEY(stretch, stretch)
 CSS_KEY(strict, strict)
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -442,42 +442,25 @@ const KTableEntry nsCSSProps::kContainKT
     {eCSSKeyword_strict, NS_STYLE_CONTAIN_STRICT},
     {eCSSKeyword_content, NS_STYLE_CONTAIN_CONTENT},
     {eCSSKeyword_layout, NS_STYLE_CONTAIN_LAYOUT},
     {eCSSKeyword_style, NS_STYLE_CONTAIN_STYLE},
     {eCSSKeyword_paint, NS_STYLE_CONTAIN_PAINT},
     {eCSSKeyword_size, NS_STYLE_CONTAIN_SIZE},
     {eCSSKeyword_UNKNOWN, -1}};
 
-const KTableEntry nsCSSProps::kOverflowClipBoxKTable[] = {
-    {eCSSKeyword_padding_box, NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX},
-    {eCSSKeyword_content_box, NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX},
-    {eCSSKeyword_UNKNOWN, -1}};
-
 const KTableEntry nsCSSProps::kOverflowSubKTable[] = {
     {eCSSKeyword_auto, NS_STYLE_OVERFLOW_AUTO},
     {eCSSKeyword_visible, NS_STYLE_OVERFLOW_VISIBLE},
     {eCSSKeyword_hidden, NS_STYLE_OVERFLOW_HIDDEN},
     {eCSSKeyword_scroll, NS_STYLE_OVERFLOW_SCROLL},
     // Deprecated:
     {eCSSKeyword__moz_hidden_unscrollable, NS_STYLE_OVERFLOW_CLIP},
     {eCSSKeyword_UNKNOWN, -1}};
 
-const KTableEntry nsCSSProps::kOverscrollBehaviorKTable[] = {
-    {eCSSKeyword_auto, StyleOverscrollBehavior::Auto},
-    {eCSSKeyword_contain, StyleOverscrollBehavior::Contain},
-    {eCSSKeyword_none, StyleOverscrollBehavior::None},
-    {eCSSKeyword_UNKNOWN, -1}};
-
-const KTableEntry nsCSSProps::kScrollSnapTypeKTable[] = {
-    {eCSSKeyword_none, NS_STYLE_SCROLL_SNAP_TYPE_NONE},
-    {eCSSKeyword_mandatory, NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY},
-    {eCSSKeyword_proximity, NS_STYLE_SCROLL_SNAP_TYPE_PROXIMITY},
-    {eCSSKeyword_UNKNOWN, -1}};
-
 const KTableEntry nsCSSProps::kTextAlignKTable[] = {
     {eCSSKeyword_left, NS_STYLE_TEXT_ALIGN_LEFT},
     {eCSSKeyword_right, NS_STYLE_TEXT_ALIGN_RIGHT},
     {eCSSKeyword_center, NS_STYLE_TEXT_ALIGN_CENTER},
     {eCSSKeyword_justify, NS_STYLE_TEXT_ALIGN_JUSTIFY},
     {eCSSKeyword__moz_center, NS_STYLE_TEXT_ALIGN_MOZ_CENTER},
     {eCSSKeyword__moz_right, NS_STYLE_TEXT_ALIGN_MOZ_RIGHT},
     {eCSSKeyword__moz_left, NS_STYLE_TEXT_ALIGN_MOZ_LEFT},
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -312,19 +312,16 @@ class nsCSSProps {
   // ------------------------------------------------------------------
   // clang-format on
   static const KTableEntry kFontSmoothingKTable[];
   static const KTableEntry kGridAutoFlowKTable[];
   static const KTableEntry kGridTrackBreadthKTable[];
   static const KTableEntry kLineHeightKTable[];
   static const KTableEntry kContainKTable[];
   static const KTableEntry kOverflowSubKTable[];
-  static const KTableEntry kOverflowClipBoxKTable[];
-  static const KTableEntry kOverscrollBehaviorKTable[];
-  static const KTableEntry kScrollSnapTypeKTable[];
   static const KTableEntry kTextAlignKTable[];
   static const KTableEntry kTextDecorationLineKTable[];
   static const KTableEntry kTextDecorationStyleKTable[];
   static const KTableEntry kTextEmphasisStyleShapeKTable[];
   static const KTableEntry kTextOverflowKTable[];
   static const KTableEntry kTouchActionKTable[];
   static const KTableEntry kVerticalAlignKTable[];
   static const KTableEntry kWidthKTable[];  // also min-width, max-width
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -1862,46 +1862,16 @@ already_AddRefed<CSSValue> nsComputedDOM
 already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginLeftWidth() {
   return GetMarginWidthFor(eSideLeft);
 }
 
 already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetMarginRightWidth() {
   return GetMarginWidthFor(eSideRight);
 }
 
-already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetOverscrollBehaviorX() {
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-  val->SetIdent(
-      nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mOverscrollBehaviorX,
-                                     nsCSSProps::kOverscrollBehaviorKTable));
-  return val.forget();
-}
-
-already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetOverscrollBehaviorY() {
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-  val->SetIdent(
-      nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mOverscrollBehaviorY,
-                                     nsCSSProps::kOverscrollBehaviorKTable));
-  return val.forget();
-}
-
-already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetScrollSnapTypeX() {
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-  val->SetIdent(nsCSSProps::ValueToKeywordEnum(
-      StyleDisplay()->mScrollSnapTypeX, nsCSSProps::kScrollSnapTypeKTable));
-  return val.forget();
-}
-
-already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetScrollSnapTypeY() {
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-  val->SetIdent(nsCSSProps::ValueToKeywordEnum(
-      StyleDisplay()->mScrollSnapTypeY, nsCSSProps::kScrollSnapTypeKTable));
-  return val.forget();
-}
-
 already_AddRefed<CSSValue> nsComputedDOMStyle::GetScrollSnapPoints(
     const nsStyleCoord& aCoord) {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   if (aCoord.GetUnit() == eStyleUnit_None) {
     val->SetIdent(eCSSKeyword_none);
   } else {
     nsAutoString argumentString;
     SetCssTextToCoord(argumentString, aCoord, true);
@@ -2547,32 +2517,16 @@ already_AddRefed<CSSValue> nsComputedDOM
 
 already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetOverflowY() {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
   val->SetIdent(nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mOverflowY,
                                                nsCSSProps::kOverflowSubKTable));
   return val.forget();
 }
 
-already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetOverflowClipBoxBlock() {
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-  val->SetIdent(
-      nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mOverflowClipBoxBlock,
-                                     nsCSSProps::kOverflowClipBoxKTable));
-  return val.forget();
-}
-
-already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetOverflowClipBoxInline() {
-  RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
-  val->SetIdent(
-      nsCSSProps::ValueToKeywordEnum(StyleDisplay()->mOverflowClipBoxInline,
-                                     nsCSSProps::kOverflowClipBoxKTable));
-  return val.forget();
-}
-
 already_AddRefed<CSSValue> nsComputedDOMStyle::DoGetTouchAction() {
   RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
 
   int32_t intValue = StyleDisplay()->mTouchAction;
 
   // None and Auto and Manipulation values aren't allowed
   // to be in conjunction with other values.
   // But there are all checks in CSSParserImpl::ParseTouchAction
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -329,27 +329,21 @@ class nsComputedDOMStyle final : public 
   already_AddRefed<CSSValue> DoGetWebkitTextStrokeWidth();
 
   /* Display properties */
   already_AddRefed<CSSValue> DoGetBinding();
   already_AddRefed<CSSValue> DoGetDisplay();
   already_AddRefed<CSSValue> DoGetContain();
   already_AddRefed<CSSValue> DoGetWillChange();
   already_AddRefed<CSSValue> DoGetOverflowY();
-  already_AddRefed<CSSValue> DoGetOverflowClipBoxBlock();
-  already_AddRefed<CSSValue> DoGetOverflowClipBoxInline();
   already_AddRefed<CSSValue> DoGetTouchAction();
   already_AddRefed<CSSValue> DoGetTransform();
   already_AddRefed<CSSValue> DoGetTransformOrigin();
   already_AddRefed<CSSValue> DoGetPerspective();
   already_AddRefed<CSSValue> DoGetPerspectiveOrigin();
-  already_AddRefed<CSSValue> DoGetOverscrollBehaviorX();
-  already_AddRefed<CSSValue> DoGetOverscrollBehaviorY();
-  already_AddRefed<CSSValue> DoGetScrollSnapTypeX();
-  already_AddRefed<CSSValue> DoGetScrollSnapTypeY();
   already_AddRefed<CSSValue> DoGetScrollSnapPointsX();
   already_AddRefed<CSSValue> DoGetScrollSnapPointsY();
   already_AddRefed<CSSValue> DoGetScrollbarColor();
 
   /* User interface properties */
   already_AddRefed<CSSValue> DoGetCaretColor();
   already_AddRefed<CSSValue> DoGetCursor();
   already_AddRefed<CSSValue> DoGetForceBrokenImageIcon();
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -137,24 +137,16 @@ enum class StyleGeometryBox : uint8_t {
                           // background-clip is 'padding' when we have a solid
                           // border" optimization.  This isn't actually equal
                           // to StyleGeometryBox::Padding because using that
                           // causes antialiasing seams between the background
                           // and border.
                           // background-clip only.
 };
 
-// float
-// https://developer.mozilla.org/en-US/docs/Web/CSS/float
-enum class StyleFloat : uint8_t {
-  None,
-  Left,
-  Right,
-};
-
 // float-edge
 enum class StyleFloatEdge : uint8_t {
   ContentBox,
   MarginBox,
 };
 
 // Hyphens
 enum class StyleHyphens : uint8_t {
@@ -569,20 +561,16 @@ enum class StyleGridTrackBreadth : uint8
 #define NS_STYLE_OVERFLOW_VISIBLE 0
 #define NS_STYLE_OVERFLOW_HIDDEN 1
 #define NS_STYLE_OVERFLOW_SCROLL 2
 #define NS_STYLE_OVERFLOW_AUTO 3
 #define NS_STYLE_OVERFLOW_CLIP 4
 #define NS_STYLE_OVERFLOW_SCROLLBARS_HORIZONTAL 5
 #define NS_STYLE_OVERFLOW_SCROLLBARS_VERTICAL 6
 
-// See nsStyleDisplay.mOverflowClipBox
-#define NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX 0
-#define NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX 1
-
 // See nsStyleList
 #define NS_STYLE_LIST_STYLE_CUSTOM -1  // for @counter-style
 #define NS_STYLE_LIST_STYLE_NONE 0
 #define NS_STYLE_LIST_STYLE_DECIMAL 1
 #define NS_STYLE_LIST_STYLE_DISC 2
 #define NS_STYLE_LIST_STYLE_CIRCLE 3
 #define NS_STYLE_LIST_STYLE_SQUARE 4
 #define NS_STYLE_LIST_STYLE_DISCLOSURE_CLOSED 5
@@ -631,22 +619,16 @@ enum class StyleGridTrackBreadth : uint8
 
 // See nsStylePosition.mObjectFit
 #define NS_STYLE_OBJECT_FIT_FILL 0
 #define NS_STYLE_OBJECT_FIT_CONTAIN 1
 #define NS_STYLE_OBJECT_FIT_COVER 2
 #define NS_STYLE_OBJECT_FIT_NONE 3
 #define NS_STYLE_OBJECT_FIT_SCALE_DOWN 4
 
-// See nsStyleDisplay
-#define NS_STYLE_RESIZE_NONE 0
-#define NS_STYLE_RESIZE_BOTH 1
-#define NS_STYLE_RESIZE_HORIZONTAL 2
-#define NS_STYLE_RESIZE_VERTICAL 3
-
 // See nsStyleText
 #define NS_STYLE_TEXT_ALIGN_START 0
 #define NS_STYLE_TEXT_ALIGN_LEFT 1
 #define NS_STYLE_TEXT_ALIGN_RIGHT 2
 #define NS_STYLE_TEXT_ALIGN_CENTER 3
 #define NS_STYLE_TEXT_ALIGN_JUSTIFY 4
 #define NS_STYLE_TEXT_ALIGN_CHAR \
   5  // align based on a certain character, for table cell
@@ -1019,23 +1001,11 @@ enum class StyleTextRendering : uint8_t 
 #define NS_STYLE_COUNTER_SPEAKAS_WORDS 2
 #define NS_STYLE_COUNTER_SPEAKAS_SPELL_OUT 3
 #define NS_STYLE_COUNTER_SPEAKAS_OTHER 255  // refer to another style
 
 // See nsStyleDisplay::mScrollBehavior
 #define NS_STYLE_SCROLL_BEHAVIOR_AUTO 0
 #define NS_STYLE_SCROLL_BEHAVIOR_SMOOTH 1
 
-// See nsStyleDisplay::mOverscrollBehavior{X,Y}
-enum class StyleOverscrollBehavior : uint8_t {
-  Auto = 0,
-  Contain,
-  None,
-};
-
-// See nsStyleDisplay::mScrollSnapType{X,Y}
-#define NS_STYLE_SCROLL_SNAP_TYPE_NONE 0
-#define NS_STYLE_SCROLL_SNAP_TYPE_MANDATORY 1
-#define NS_STYLE_SCROLL_SNAP_TYPE_PROXIMITY 2
-
 }  // namespace mozilla
 
 #endif /* nsStyleConsts_h___ */
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2974,29 +2974,29 @@ nsStyleDisplay::nsStyleDisplay(const nsP
       mFloat(StyleFloat::None),
       mOriginalFloat(StyleFloat::None),
       mBreakType(StyleClear::None),
       mBreakInside(StyleBreakWithin::Auto),
       mBreakBefore(StyleBreakBetween::Auto),
       mBreakAfter(StyleBreakBetween::Auto),
       mOverflowX(NS_STYLE_OVERFLOW_VISIBLE),
       mOverflowY(NS_STYLE_OVERFLOW_VISIBLE),
-      mOverflowClipBoxBlock(NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX),
-      mOverflowClipBoxInline(NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX),
-      mResize(NS_STYLE_RESIZE_NONE),
+      mOverflowClipBoxBlock(StyleOverflowClipBox::PaddingBox),
+      mOverflowClipBoxInline(StyleOverflowClipBox::PaddingBox),
+      mResize(StyleResize::None),
       mOrient(StyleOrient::Inline),
       mIsolation(NS_STYLE_ISOLATION_AUTO),
       mTopLayer(NS_STYLE_TOP_LAYER_NONE),
       mWillChangeBitField(0),
       mTouchAction(NS_STYLE_TOUCH_ACTION_AUTO),
       mScrollBehavior(NS_STYLE_SCROLL_BEHAVIOR_AUTO),
       mOverscrollBehaviorX(StyleOverscrollBehavior::Auto),
       mOverscrollBehaviorY(StyleOverscrollBehavior::Auto),
-      mScrollSnapTypeX(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
-      mScrollSnapTypeY(NS_STYLE_SCROLL_SNAP_TYPE_NONE),
+      mScrollSnapTypeX(StyleScrollSnapType::None),
+      mScrollSnapTypeY(StyleScrollSnapType::None),
       mScrollSnapPointsX(eStyleUnit_None),
       mScrollSnapPointsY(eStyleUnit_None),
       mBackfaceVisibility(NS_STYLE_BACKFACE_VISIBILITY_VISIBLE),
       mTransformStyle(NS_STYLE_TRANSFORM_STYLE_FLAT),
       mTransformBox(StyleGeometryBox::BorderBox),
       mTransformOrigin{
           {0.5f, eStyleUnit_Percent},  // Transform is centered on origin
           {0.5f, eStyleUnit_Percent},
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1897,38 +1897,38 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   mozilla::StyleFloat mFloat;
   // Save mFloat for position:absolute/fixed; otherwise equal to mFloat.
   mozilla::StyleFloat mOriginalFloat;
 
   mozilla::StyleClear mBreakType;
   mozilla::StyleBreakWithin mBreakInside;
   mozilla::StyleBreakBetween mBreakBefore;
   mozilla::StyleBreakBetween mBreakAfter;
-  uint8_t mOverflowX;              // NS_STYLE_OVERFLOW_*
-  uint8_t mOverflowY;              // NS_STYLE_OVERFLOW_*
-  uint8_t mOverflowClipBoxBlock;   // NS_STYLE_OVERFLOW_CLIP_BOX_*
-  uint8_t mOverflowClipBoxInline;  // NS_STYLE_OVERFLOW_CLIP_BOX_*
-  uint8_t mResize;                 // NS_STYLE_RESIZE_*
+  uint8_t mOverflowX;  // NS_STYLE_OVERFLOW_*
+  uint8_t mOverflowY;  // NS_STYLE_OVERFLOW_*
+  mozilla::StyleOverflowClipBox mOverflowClipBoxBlock;
+  mozilla::StyleOverflowClipBox mOverflowClipBoxInline;
+  mozilla::StyleResize mResize;
   mozilla::StyleOrient mOrient;
   uint8_t mIsolation;           // NS_STYLE_ISOLATION_*
   uint8_t mTopLayer;            // NS_STYLE_TOP_LAYER_*
   uint8_t mWillChangeBitField;  // NS_STYLE_WILL_CHANGE_*
                                 // Stores a bitfield representation of the
                                 // properties that are frequently queried. This
                                 // should match mWillChange. Also tracks if any
                                 // of the properties in the will-change list
                                 // require a stacking context.
   nsTArray<RefPtr<nsAtom>> mWillChange;
 
   uint8_t mTouchAction;     // NS_STYLE_TOUCH_ACTION_*
   uint8_t mScrollBehavior;  // NS_STYLE_SCROLL_BEHAVIOR_*
   mozilla::StyleOverscrollBehavior mOverscrollBehaviorX;
   mozilla::StyleOverscrollBehavior mOverscrollBehaviorY;
-  uint8_t mScrollSnapTypeX;  // NS_STYLE_SCROLL_SNAP_TYPE_*
-  uint8_t mScrollSnapTypeY;  // NS_STYLE_SCROLL_SNAP_TYPE_*
+  mozilla::StyleScrollSnapType mScrollSnapTypeX;
+  mozilla::StyleScrollSnapType mScrollSnapTypeY;
   nsStyleCoord mScrollSnapPointsX;
   nsStyleCoord mScrollSnapPointsY;
   mozilla::Position mScrollSnapDestination;
   nsTArray<mozilla::Position> mScrollSnapCoordinate;
 
   // mSpecifiedTransform is the list of transform functions as
   // specified, or null to indicate there is no transform.  (inherit or
   // initial are replaced by an actual list of transform functions, or
--- a/servo/components/style/cbindgen.toml
+++ b/servo/components/style/cbindgen.toml
@@ -54,10 +54,15 @@ include = [
   "FontDisplay",
   "FontFaceSourceListComponent",
   "FontLanguageOverride",
   "OverflowWrap",
   "TimingFunction",
   "PathCommand",
   "UnicodeRange",
   "UserSelect",
+  "Float",
+  "OverscrollBehavior",
+  "ScrollSnapType",
+  "OverflowClipBox",
+  "Resize",
 ]
 item_types = ["enums", "structs", "typedefs"]
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -1384,18 +1384,24 @@ impl Clone for ${style_struct.gecko_stru
 <%def name="impl_trait(style_struct_name, skip_longhands='')">
 <%
     style_struct = next(x for x in data.style_structs if x.name == style_struct_name)
     longhands = [x for x in style_struct.longhands
                 if not (skip_longhands == "*" or x.name in skip_longhands.split())]
 
     # Types used with predefined_type()-defined properties that we can auto-generate.
     predefined_types = {
+        "Appearance": impl_simple,
+        "OverscrollBehavior": impl_simple,
+        "OverflowClipBox": impl_simple,
+        "ScrollSnapType": impl_simple,
+        "Float": impl_simple,
         "BreakBetween": impl_simple,
         "BreakWithin": impl_simple,
+        "Resize": impl_simple,
         "Color": impl_color,
         "ColorOrAuto": impl_color,
         "GreaterThanOrEqualToOneNumber": impl_simple,
         "Integer": impl_simple,
         "length::LengthOrAuto": impl_style_coord,
         "length::LengthOrNormal": impl_style_coord,
         "length::NonNegativeLengthOrAuto": impl_style_coord,
         "length::NonNegativeLengthOrPercentageOrNormal": impl_style_coord,
@@ -3000,30 +3006,28 @@ fn static_assert() {
         let list = unsafe { (*self.gecko.${gecko_ffi_name}.to_safe().get()).mHead.as_ref() };
 
         let mut transform = clone_transform_from_list(list);
         debug_assert_eq!(transform.0.len(), 1);
         ${type}::from_transform_operation(&transform.0.pop().unwrap())
     }
 </%def>
 
-<% skip_box_longhands= """display -moz-appearance overflow-y vertical-align
+<% skip_box_longhands= """display overflow-y vertical-align
                           animation-name animation-delay animation-duration
                           animation-direction animation-fill-mode animation-play-state
                           animation-iteration-count animation-timing-function
-                          transition-duration transition-delay
+                          clear transition-duration transition-delay
                           transition-timing-function transition-property
                           rotate scroll-snap-points-x scroll-snap-points-y
-                          scroll-snap-type-x scroll-snap-type-y scroll-snap-coordinate
+                          scroll-snap-coordinate
                           perspective-origin -moz-binding will-change
-                          offset-path overscroll-behavior-x overscroll-behavior-y
-                          overflow-clip-box-inline overflow-clip-box-block
-                          perspective-origin -moz-binding will-change
-                          shape-outside contain touch-action translate
-                          scale""" %>
+                          offset-path perspective-origin -moz-binding
+                          will-change shape-outside contain touch-action
+                          translate scale""" %>
 <%self:impl_trait style_struct_name="Box" skip_longhands="${skip_box_longhands}">
     #[inline]
     pub fn set_display(&mut self, v: longhands::display::computed_value::T) {
         self.gecko.mDisplay = v;
         self.gecko.mOriginalDisplay = v;
     }
 
     #[inline]
@@ -3046,32 +3050,24 @@ fn static_assert() {
         self.gecko.mDisplay = v;
     }
 
     #[inline]
     pub fn clone_display(&self) -> longhands::display::computed_value::T {
         self.gecko.mDisplay
     }
 
-    ${impl_simple('_moz_appearance', 'mAppearance')}
-
-    <% float_keyword = Keyword("float", "Left Right None", gecko_enum_prefix="StyleFloat") %>
-    ${impl_keyword('float', 'mFloat', float_keyword)}
-
     <% clear_keyword = Keyword(
         "clear",
         "Left Right None Both",
         gecko_enum_prefix="StyleClear",
         gecko_inexhaustive=True,
     ) %>
     ${impl_keyword('clear', 'mBreakType', clear_keyword)}
 
-    <% resize_keyword = Keyword("resize", "None Both Horizontal Vertical") %>
-    ${impl_keyword('resize', 'mResize', resize_keyword)}
-
     <% overflow_x = data.longhands_by_name["overflow-x"] %>
     pub fn set_overflow_y(&mut self, v: longhands::overflow_y::computed_value::T) {
         use crate::properties::longhands::overflow_x::computed_value::T as BaseType;
         // FIXME(bholley): Align binary representations and ditch |match| for cast + static_asserts
         self.gecko.mOverflowY = match v {
             % for value in overflow_x.keyword.values_for('gecko'):
                 BaseType::${to_camel_case(value)} => structs::${overflow_x.keyword.gecko_constant(value)} as u8,
             % endfor
@@ -3393,29 +3389,16 @@ fn static_assert() {
         }
     }
 
     ${impl_animation_count('iteration_count', 'IterationCount')}
     ${impl_copy_animation_value('iteration_count', 'IterationCount')}
 
     ${impl_animation_timing_function()}
 
-    <% scroll_snap_type_keyword = Keyword("scroll-snap-type", "None Mandatory Proximity") %>
-    ${impl_keyword('scroll_snap_type_y', 'mScrollSnapTypeY', scroll_snap_type_keyword)}
-    ${impl_keyword('scroll_snap_type_x', 'mScrollSnapTypeX', scroll_snap_type_keyword)}
-
-    <% overscroll_behavior_keyword = Keyword("overscroll-behavior", "Auto Contain None",
-                                             gecko_enum_prefix="StyleOverscrollBehavior") %>
-    ${impl_keyword('overscroll_behavior_x', 'mOverscrollBehaviorX', overscroll_behavior_keyword)}
-    ${impl_keyword('overscroll_behavior_y', 'mOverscrollBehaviorY', overscroll_behavior_keyword)}
-
-    <% overflow_clip_box_keyword = Keyword("overflow-clip-box", "padding-box content-box") %>
-    ${impl_keyword('overflow_clip_box_inline', 'mOverflowClipBoxInline', overflow_clip_box_keyword)}
-    ${impl_keyword('overflow_clip_box_block', 'mOverflowClipBoxBlock', overflow_clip_box_keyword)}
-
     pub fn set_perspective_origin(&mut self, v: longhands::perspective_origin::computed_value::T) {
         self.gecko.mPerspectiveOrigin[0].set(v.horizontal);
         self.gecko.mPerspectiveOrigin[1].set(v.vertical);
     }
 
     pub fn copy_perspective_origin_from(&mut self, other: &Self) {
         self.gecko.mPerspectiveOrigin[0].copy_from(&other.gecko.mPerspectiveOrigin[0]);
         self.gecko.mPerspectiveOrigin[1].copy_from(&other.gecko.mPerspectiveOrigin[1]);
--- a/servo/components/style/properties/longhands/box.mako.rs
+++ b/servo/components/style/properties/longhands/box.mako.rs
@@ -569,16 +569,17 @@
 ${helpers.predefined_type(
     "-moz-appearance",
     "Appearance",
     "computed::Appearance::None",
     products="gecko",
     alias="-webkit-appearance:layout.css.webkit-appearance.enabled",
     spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-appearance)",
     animation_value_type="discrete",
+    gecko_ffi_name="mAppearance",
 )}
 
 ${helpers.predefined_type(
     "-moz-binding",
     "url::UrlOrNone",
     "computed::url::UrlOrNone::none()",
     products="gecko",
     animation_value_type="none",
--- a/servo/components/style/values/computed/box.rs
+++ b/servo/components/style/values/computed/box.rs
@@ -34,16 +34,17 @@ impl AnimationIterationCount {
 /// A computed value for the `perspective` property.
 pub type Perspective = GenericPerspective<NonNegativeLength>;
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 #[derive(
     Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, SpecifiedValueInfo, ToCss,
 )]
+#[repr(u8)]
 /// A computed value for the `float` property.
 pub enum Float {
     Left,
     Right,
     None,
 }
 
 impl ToComputedValue for SpecifiedFloat {
@@ -152,16 +153,17 @@ impl ToComputedValue for SpecifiedClear 
         }
     }
 }
 
 /// A computed value for the `resize` property.
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
 #[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, Parse, PartialEq, ToCss)]
+#[repr(u8)]
 pub enum Resize {
     None,
     Both,
     Horizontal,
     Vertical,
 }
 
 impl ToComputedValue for specified::Resize {
--- a/servo/components/style/values/specified/box.rs
+++ b/servo/components/style/values/specified/box.rs
@@ -384,16 +384,17 @@ impl Parse for AnimationName {
     Eq,
     MallocSizeOf,
     Parse,
     PartialEq,
     SpecifiedValueInfo,
     ToComputedValue,
     ToCss,
 )]
+#[repr(u8)]
 pub enum ScrollSnapType {
     None,
     Mandatory,
     Proximity,
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
@@ -404,16 +405,17 @@ pub enum ScrollSnapType {
     Eq,
     MallocSizeOf,
     Parse,
     PartialEq,
     SpecifiedValueInfo,
     ToComputedValue,
     ToCss,
 )]
+#[repr(u8)]
 pub enum OverscrollBehavior {
     Auto,
     Contain,
     None,
 }
 
 #[allow(missing_docs)]
 #[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
@@ -424,16 +426,17 @@ pub enum OverscrollBehavior {
     Eq,
     MallocSizeOf,
     Parse,
     PartialEq,
     SpecifiedValueInfo,
     ToComputedValue,
     ToCss,
 )]
+#[repr(u8)]
 pub enum OverflowClipBox {
     PaddingBox,
     ContentBox,
 }
 
 #[derive(Clone, Debug, MallocSizeOf, PartialEq, SpecifiedValueInfo, ToComputedValue, ToCss)]
 /// Provides a rendering hint to the user agent,
 /// stating what kinds of changes the author expects