Bug 1430014 - Part 7: #ifdef out a bit more animation-related code. r?xidorn draft
authorCameron McCormack <cam@mcc.id.au>
Wed, 17 Jan 2018 11:20:09 +0800
changeset 721341 fb8c3f8bce0f95952728c60f5cb73abe38ff4144
parent 720813 58617bd3a1de7ae3f4372348ccdf5b5812c521ac
child 746307 a0ab325701b9388920f54373476ce9fed006125a
push id95808
push userbmo:cam@mcc.id.au
push dateWed, 17 Jan 2018 04:38:08 +0000
reviewersxidorn
bugs1430014
milestone59.0a1
Bug 1430014 - Part 7: #ifdef out a bit more animation-related code. r?xidorn MozReview-Commit-ID: B9TaVJFak26
dom/animation/KeyframeEffectReadOnly.cpp
dom/animation/KeyframeEffectReadOnly.h
dom/smil/nsSMILCSSValueType.cpp
gfx/config/gfxVars.h
gfx/layers/AnimationHelper.cpp
layout/painting/nsDisplayList.cpp
layout/style/StyleAnimationValue.cpp
layout/style/StyleAnimationValue.h
layout/style/nsTransitionManager.cpp
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -390,16 +390,17 @@ KeyframeEffectReadOnly::DoUpdateProperti
 
   CalculateCumulativeChangeHint(aStyle);
 
   MarkCascadeNeedsUpdate();
 
   RequestRestyle(EffectCompositor::RestyleType::Layer);
 }
 
+#ifdef MOZ_OLD_STYLE
 /* static */ StyleAnimationValue
 KeyframeEffectReadOnly::CompositeValue(
   nsCSSPropertyID aProperty,
   const StyleAnimationValue& aValueToComposite,
   const StyleAnimationValue& aUnderlyingValue,
   CompositeOperation aCompositeOperation)
 {
   // Just return the underlying value if |aValueToComposite| is null
@@ -425,17 +426,16 @@ KeyframeEffectReadOnly::CompositeValue(
     }
     default:
       MOZ_ASSERT_UNREACHABLE("Unknown compisite operation type");
       break;
   }
   return StyleAnimationValue();
 }
 
-#ifdef MOZ_OLD_STYLE
 StyleAnimationValue
 KeyframeEffectReadOnly::GetUnderlyingStyle(
   nsCSSPropertyID aProperty,
   const RefPtr<AnimValuesStyleRule>& aAnimationRule)
 {
   StyleAnimationValue result;
 
   if (aAnimationRule && aAnimationRule->HasValue(aProperty)) {
@@ -1359,43 +1359,49 @@ KeyframeEffectReadOnly::GetKeyframes(JSC
             mBaseStyleValuesForServo.GetWeak(propertyValue.mProperty);
 
           if (value) {
             Servo_AnimationValue_Serialize(value,
                                            propertyValue.mProperty,
                                            &stringValue);
           }
         }
-      } else if (nsCSSProps::IsShorthand(propertyValue.mProperty)) {
-         // nsCSSValue::AppendToString does not accept shorthands properties but
-         // works with token stream values if we pass eCSSProperty_UNKNOWN as
-         // the property.
-         propertyValue.mValue.AppendToString(
-           eCSSProperty_UNKNOWN, stringValue);
       } else {
-        nsCSSValue cssValue = propertyValue.mValue;
-        if (cssValue.GetUnit() == eCSSUnit_Null) {
-          // We use an uninitialized nsCSSValue to represent the
-          // "neutral value". We currently only do this for keyframes generated
-          // from CSS animations with missing 0%/100% keyframes. Furthermore,
-          // currently (at least until bug 1339334) keyframes generated from
-          // CSS animations only contain longhand properties so we only need to
-          // handle null nsCSSValues for longhand properties.
-          DebugOnly<bool> uncomputeResult =
-            StyleAnimationValue::UncomputeValue(
-              propertyValue.mProperty,
-              Move(BaseStyle(propertyValue.mProperty).mGecko),
-              cssValue);
+#ifdef MOZ_OLD_STYLE
+        if (nsCSSProps::IsShorthand(propertyValue.mProperty)) {
+           // nsCSSValue::AppendToString does not accept shorthands properties but
+           // works with token stream values if we pass eCSSProperty_UNKNOWN as
+           // the property.
+           propertyValue.mValue.AppendToString(
+             eCSSProperty_UNKNOWN, stringValue);
+        } else {
+          nsCSSValue cssValue = propertyValue.mValue;
+          if (cssValue.GetUnit() == eCSSUnit_Null) {
+            // We use an uninitialized nsCSSValue to represent the
+            // "neutral value". We currently only do this for keyframes generated
+            // from CSS animations with missing 0%/100% keyframes. Furthermore,
+            // currently (at least until bug 1339334) keyframes generated from
+            // CSS animations only contain longhand properties so we only need to
+            // handle null nsCSSValues for longhand properties.
+            DebugOnly<bool> uncomputeResult =
+              StyleAnimationValue::UncomputeValue(
+                propertyValue.mProperty,
+                Move(BaseStyle(propertyValue.mProperty).mGecko),
+                cssValue);
 
-          MOZ_ASSERT(uncomputeResult,
-                     "Unable to get specified value from computed value");
-          MOZ_ASSERT(cssValue.GetUnit() != eCSSUnit_Null,
-                     "Got null computed value");
+            MOZ_ASSERT(uncomputeResult,
+                       "Unable to get specified value from computed value");
+            MOZ_ASSERT(cssValue.GetUnit() != eCSSUnit_Null,
+                       "Got null computed value");
+          }
+          cssValue.AppendToString(propertyValue.mProperty, stringValue);
         }
-        cssValue.AppendToString(propertyValue.mProperty, stringValue);
+#else
+        MOZ_CRASH("old style system disabled");
+#endif
       }
 
       const char* name = nsCSSProps::PropertyIDLName(propertyValue.mProperty);
       JS::Rooted<JS::Value> value(aCx);
       if (!ToJSValue(aCx, stringValue, &value) ||
           !JS_DefineProperty(aCx, keyframeObject, name, value,
                              JSPROP_ENUMERATE)) {
         aRv.Throw(NS_ERROR_FAILURE);
--- a/dom/animation/KeyframeEffectReadOnly.h
+++ b/dom/animation/KeyframeEffectReadOnly.h
@@ -209,24 +209,26 @@ public:
 
   // Updates |aComposeResult| with the animation values produced by this
   // AnimationEffect for the current time except any properties contained
   // in |aPropertiesToSkip|.
   template<typename ComposeAnimationResult>
   void ComposeStyle(ComposeAnimationResult&& aRestultContainer,
                     const nsCSSPropertyIDSet& aPropertiesToSkip);
 
+#ifdef MOZ_OLD_STYLE
   // Composite |aValueToComposite| on |aUnderlyingValue| with
   // |aCompositeOperation|.
   // Returns |aValueToComposite| if |aCompositeOperation| is Replace.
   static StyleAnimationValue CompositeValue(
     nsCSSPropertyID aProperty,
     const StyleAnimationValue& aValueToComposite,
     const StyleAnimationValue& aUnderlyingValue,
     CompositeOperation aCompositeOperation);
+#endif
 
   // Returns true if at least one property is being animated on compositor.
   bool IsRunningOnCompositor() const;
   void SetIsRunningOnCompositor(nsCSSPropertyID aProperty, bool aIsRunning);
   void ResetIsRunningOnCompositor();
 
   // Returns true if this effect, applied to |aFrame|, contains properties
   // that mean we shouldn't run transform compositor animations on this element.
@@ -276,17 +278,21 @@ public:
     AnimationValue result;
     bool hasProperty = false;
     if (mDocument->IsStyledByServo()) {
       // We cannot use getters_AddRefs on RawServoAnimationValue because it is
       // an incomplete type, so Get() doesn't work. Instead, use GetWeak, and
       // then assign the raw pointer to a RefPtr.
       result.mServo = mBaseStyleValuesForServo.GetWeak(aProperty, &hasProperty);
     } else {
+#ifdef MOZ_OLD_STYLE
       hasProperty = mBaseStyleValues.Get(aProperty, &result.mGecko);
+#else
+      MOZ_CRASH("old style system disabled");
+#endif
     }
     MOZ_ASSERT(hasProperty || result.IsNull());
     return result;
   }
 
 protected:
   KeyframeEffectReadOnly(nsIDocument* aDocument,
                          const Maybe<OwningAnimationTarget>& aTarget,
@@ -411,17 +417,19 @@ protected:
 
   // We need to track when we go to or from being "in effect" since
   // we need to re-evaluate the cascade of animations when that changes.
   bool mInEffectOnLastAnimationTimingUpdate;
 
   // The non-animated values for properties in this effect that contain at
   // least one animation value that is composited with the underlying value
   // (i.e. it uses the additive or accumulate composite mode).
+#ifdef MOZ_OLD_STYLE
   nsDataHashtable<nsUint32HashKey, StyleAnimationValue> mBaseStyleValues;
+#endif
   nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>
     mBaseStyleValuesForServo;
 
   // True if this effect is in the EffectSet for its target element. This is
   // used as an optimization to avoid unnecessary hashmap lookups on the
   // EffectSet.
   bool mInEffectSet = false;
 
--- a/dom/smil/nsSMILCSSValueType.cpp
+++ b/dom/smil/nsSMILCSSValueType.cpp
@@ -36,20 +36,26 @@ typedef AutoTArray<RefPtr<RawServoAnimat
 struct ValueWrapper {
   ValueWrapper(nsCSSPropertyID aPropID, const AnimationValue& aValue)
     : mPropID(aPropID)
   {
     if (aValue.mServo) {
       mServoValues.AppendElement(aValue.mServo);
       return;
     }
+#ifdef MOZ_OLD_STYLE
     mGeckoValue = aValue.mGecko;
+#else
+    MOZ_CRASH("old style system disabled");
+#endif
   }
+#ifdef MOZ_OLD_STYLE
   ValueWrapper(nsCSSPropertyID aPropID, const StyleAnimationValue& aValue)
     : mPropID(aPropID), mGeckoValue(aValue) {}
+#endif
   ValueWrapper(nsCSSPropertyID aPropID,
                const RefPtr<RawServoAnimationValue>& aValue)
     : mPropID(aPropID), mServoValues{(aValue)} {}
   ValueWrapper(nsCSSPropertyID aPropID, ServoAnimationValues&& aValues)
     : mPropID(aPropID), mServoValues{aValues} {}
 
   bool operator==(const ValueWrapper& aOther) const
   {
@@ -66,32 +72,38 @@ struct ValueWrapper {
         if (!Servo_AnimationValue_DeepEqual(mServoValues[i],
                                             aOther.mServoValues[i])) {
           return false;
         }
       }
       return true;
     }
 
+#ifdef MOZ_OLD_STYLE
     return mGeckoValue == aOther.mGeckoValue;
+#else
+    MOZ_CRASH("old style system disabled");
+#endif
   }
 
   bool operator!=(const ValueWrapper& aOther) const
   {
     return !(*this == aOther);
   }
 
   nsCSSPropertyID mPropID;
   ServoAnimationValues mServoValues;
+#ifdef MOZ_OLD_STYLE
   StyleAnimationValue mGeckoValue;
-
+#endif
 };
 
 // Helper Methods
 // --------------
+#ifdef MOZ_OLD_STYLE
 static const StyleAnimationValue*
 GetZeroValueForUnit(StyleAnimationValue::Unit aUnit)
 {
   static const StyleAnimationValue
     sZeroCoord(0, StyleAnimationValue::CoordConstructor);
   static const StyleAnimationValue
     sZeroPercent(0.0f, StyleAnimationValue::PercentConstructor);
   static const StyleAnimationValue
@@ -109,16 +121,17 @@ GetZeroValueForUnit(StyleAnimationValue:
     case StyleAnimationValue::eUnit_Float:
       return &sZeroFloat;
     case StyleAnimationValue::eUnit_Color:
       return &sZeroColor;
     default:
       return nullptr;
   }
 }
+#endif
 
 // If one argument is null, this method updates it to point to "zero"
 // for the other argument's Unit (if applicable; otherwise, we return false).
 //
 // If neither argument is null, this method simply returns true.
 //
 // If both arguments are null, this method returns false.
 //
@@ -143,16 +156,17 @@ FinalizeServoAnimationValues(const RefPt
     aValue1 = &aZeroValueStorage;
   } else if (!aValue2) {
     aZeroValueStorage = Servo_AnimationValues_GetZeroValue(*aValue1).Consume();
     aValue2 = &aZeroValueStorage;
   }
   return *aValue1 && *aValue2;
 }
 
+#ifdef MOZ_OLD_STYLE
 static bool
 FinalizeStyleAnimationValues(const StyleAnimationValue*& aValue1,
                              const StyleAnimationValue*& aValue2)
 {
   if (!aValue1 && !aValue2) {
     return false;
   }
 
@@ -178,17 +192,16 @@ FinalizeStyleAnimationValues(const Style
   } else if (*aValue2 == zeroCoord &&
              aValue1->GetUnit() == StyleAnimationValue::eUnit_Float) {
     aValue2 = GetZeroValueForUnit(StyleAnimationValue::eUnit_Float);
   }
 
   return true;
 }
 
-#ifdef MOZ_OLD_STYLE
 static void
 InvertSign(StyleAnimationValue& aValue)
 {
   switch (aValue.GetUnit()) {
     case StyleAnimationValue::eUnit_Coord:
       aValue.SetCoordValue(-aValue.GetCoordValue());
       break;
     case StyleAnimationValue::eUnit_Percent:
@@ -395,16 +408,17 @@ AddOrAccumulate(nsSMILValue& aDest, cons
   if (isServo) {
     return AddOrAccumulateForServo(aDest,
                                    valueToAddWrapper,
                                    destWrapper,
                                    aCompositeOp,
                                    aCount);
   }
 
+#ifdef MOZ_OLD_STYLE
   const StyleAnimationValue* valueToAdd = valueToAddWrapper ?
     &valueToAddWrapper->mGeckoValue : nullptr;
   const StyleAnimationValue* destValue = destWrapper ?
     &destWrapper->mGeckoValue : nullptr;
   if (!FinalizeStyleAnimationValues(valueToAdd, destValue)) {
     return false;
   }
   // Did FinalizeStyleAnimationValues change destValue?
@@ -421,16 +435,19 @@ AddOrAccumulate(nsSMILValue& aDest, cons
   // For Gecko, we currently call Add for either composite mode.
   //
   // This is not ideal, but it doesn't make any difference for the set of
   // properties we currently allow adding in SMIL and this code path will
   // hopefully become obsolete before we expand that set.
   return StyleAnimationValue::Add(property,
                                   destWrapper->mGeckoValue,
                                   *valueToAdd, aCount);
+#else
+  MOZ_CRASH("old style system disabled");
+#endif
 }
 
 nsresult
 nsSMILCSSValueType::SandwichAdd(nsSMILValue& aDest,
                                 const nsSMILValue& aValueToAdd) const
 {
   return AddOrAccumulate(aDest, aValueToAdd, CompositeOperation::Add, 1)
          ? NS_OK
@@ -517,16 +534,17 @@ nsSMILCSSValueType::ComputeDistance(cons
                                               aDistance)
          ? NS_OK
          : NS_ERROR_FAILURE;
 #else
   MOZ_CRASH("old style system disabled");
 #endif
 }
 
+#ifdef MOZ_OLD_STYLE
 static nsresult
 InterpolateForGecko(const ValueWrapper* aStartWrapper,
                     const ValueWrapper& aEndWrapper,
                     double aUnitDistance,
                     nsSMILValue& aResult)
 {
   const StyleAnimationValue* startCSSValue = aStartWrapper
                                              ? &aStartWrapper->mGeckoValue
@@ -541,16 +559,17 @@ InterpolateForGecko(const ValueWrapper* 
                                        *startCSSValue,
                                        *endCSSValue,
                                        aUnitDistance, resultValue)) {
     aResult.mU.mPtr = new ValueWrapper(aEndWrapper.mPropID, resultValue);
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
+#endif
 
 static nsresult
 InterpolateForServo(const ValueWrapper* aStartWrapper,
                     const ValueWrapper& aEndWrapper,
                     double aUnitDistance,
                     nsSMILValue& aResult)
 {
   // For discretely-animated properties Servo_AnimationValues_Interpolate will
@@ -620,20 +639,24 @@ nsSMILCSSValueType::Interpolate(const ns
 
   if (!endWrapper->mServoValues.IsEmpty()) {
     return InterpolateForServo(startWrapper,
                                *endWrapper,
                                aUnitDistance,
                                aResult);
   }
 
+#ifdef MOZ_OLD_STYLE
   return InterpolateForGecko(startWrapper,
                              *endWrapper,
                              aUnitDistance,
                              aResult);
+#else
+  MOZ_CRASH("old style system disabled");
+#endif
 }
 
 // Helper function to extract presContext
 static nsPresContext*
 GetPresContextForElement(Element* aElem)
 {
   nsIDocument* doc = aElem->GetUncomposedDoc();
   if (!doc) {
@@ -838,21 +861,25 @@ nsSMILCSSValueType::ValueToString(const 
   MOZ_ASSERT(aValue.mType == &nsSMILCSSValueType::sSingleton,
              "Unexpected SMIL value type");
   const ValueWrapper* wrapper = ExtractValueWrapper(aValue);
   if (!wrapper) {
     return;
   }
 
   if (wrapper->mServoValues.IsEmpty()) {
+#ifdef MOZ_OLD_STYLE
     DebugOnly<bool> uncomputeResult =
       StyleAnimationValue::UncomputeValue(wrapper->mPropID,
                                           wrapper->mGeckoValue,
                                           aString);
     return;
+#else
+    MOZ_CRASH("old style system disabled");
+#endif
   }
 
   if (nsCSSProps::IsShorthand(wrapper->mPropID)) {
     // In case of shorthand on servo, we iterate over all mServoValues array
     // since we have multiple AnimationValues in the array for each longhand
     // component.
     Servo_Shorthand_AnimationValues_Serialize(wrapper->mPropID,
                                               &wrapper->mServoValues,
@@ -914,17 +941,21 @@ nsSMILCSSValueType::FinalizeValue(nsSMIL
       if (!zeroValue) {
         return;
       }
       zeroValues.AppendElement(Move(zeroValue));
     }
     aValue.mU.mPtr = new ValueWrapper(valueToMatchWrapper->mPropID,
                                       Move(zeroValues));
   } else {
+#ifdef MOZ_OLD_STYLE
     const StyleAnimationValue* zeroValue =
       GetZeroValueForUnit(valueToMatchWrapper->mGeckoValue.GetUnit());
     if (!zeroValue) {
       return;
     }
     aValue.mU.mPtr = new ValueWrapper(valueToMatchWrapper->mPropID,
                                       *zeroValue);
+#else
+    MOZ_CRASH("old style system disabled");
+#endif
   }
 }
--- a/gfx/config/gfxVars.h
+++ b/gfx/config/gfxVars.h
@@ -40,25 +40,16 @@ class gfxVarReceiver;
   _(WebRenderDebugFlags,        int32_t,          0)                    \
   _(ScreenDepth,                int32_t,          0)                    \
   _(GREDirectory,               nsCString,        nsCString())          \
   _(UseOMTP,                    bool,             false)                \
   _(AllowD3D11KeyedMutex,       bool,             false)                \
 
   /* Add new entries above this line. */
 
-// Define the default animation backend on the compositor. Now we don't use
-// stylo on the compositor only on Android, and this is a fixed flag. If
-// we want to update this flag, please add a new gfxVars for it.
-#if defined(MOZ_STYLO) && !defined(ANDROID)
-  #define USE_STYLO_ON_COMPOSITOR true
-#else
-  #define USE_STYLO_ON_COMPOSITOR false
-#endif
-
 // Some graphics settings are computed on the UI process and must be
 // communicated to content and GPU processes. gfxVars helps facilitate
 // this. Its function is similar to gfxPrefs, except rather than hold
 // user preferences, it holds dynamically computed values.
 //
 // Each variable in GFX_VARS_LIST exposes the following static methods:
 //
 //    const DataType& CxxName();
--- a/gfx/layers/AnimationHelper.cpp
+++ b/gfx/layers/AnimationHelper.cpp
@@ -4,17 +4,16 @@
  * 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/. */
 
 #include "AnimationHelper.h"
 #include "mozilla/ComputedTimingFunction.h" // for ComputedTimingFunction
 #include "mozilla/dom/AnimationEffectReadOnlyBinding.h" // for dom::FillMode
 #include "mozilla/dom/KeyframeEffectBinding.h" // for dom::IterationComposite
 #include "mozilla/dom/KeyframeEffectReadOnly.h" // for dom::KeyFrameEffectReadOnly
-#include "mozilla/gfx/gfxVars.h"        // for USE_STYLO_ON_COMPOSITOR
 #include "mozilla/layers/CompositorThread.h" // for CompositorThreadHolder
 #include "mozilla/layers/LayerAnimationUtils.h" // for TimingFunctionToComputedTimingFunction
 #include "mozilla/StyleAnimationValue.h" // for StyleAnimationValue, etc
 #include "nsDeviceContext.h"            // for AppUnitsPerCSSPixel
 #include "nsDisplayList.h"              // for nsDisplayTransform, etc
 
 namespace mozilla {
 namespace layers {
@@ -128,16 +127,17 @@ CompositorAnimationStorage::GetAnimation
 void
 CompositorAnimationStorage::SetAnimations(uint64_t aId, const AnimationArray& aValue)
 {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
   AnimationArray* value = new AnimationArray(aValue);
   mAnimations.Put(aId, value);
 }
 
+#ifndef MOZ_STYLO
 static StyleAnimationValue
 SampleValue(double aPortion, const layers::Animation& aAnimation,
             const AnimationPropertySegment&& aSegment,
             const StyleAnimationValue& aLastValue,
             uint64_t aCurrentIteration,
             const StyleAnimationValue& aUnderlyingValue)
 {
   NS_ASSERTION(aSegment.mFromValue.mGecko.IsNull() ||
@@ -185,16 +185,17 @@ SampleValue(double aPortion, const layer
   // to the compositor and they should never fail to interpolate.
   DebugOnly<bool> uncomputeResult =
     StyleAnimationValue::Interpolate(aAnimation.property(),
                                      startValue, endValue,
                                      aPortion, interpolatedValue);
   MOZ_ASSERT(uncomputeResult, "could not uncompute value");
   return interpolatedValue;
 }
+#endif
 
 bool
 AnimationHelper::SampleAnimationForEachNode(
   TimeStamp aTime,
   AnimationArray& aAnimations,
   InfallibleTArray<AnimData>& aAnimationData,
   AnimationValue& aAnimationValue,
   bool& aHasInEffectAnimations)
@@ -272,38 +273,40 @@ AnimationHelper::SampleAnimationForEachN
     animSegment.mFromValue = animData.mStartValues[segmentIndex];
     animSegment.mToValue = animData.mEndValues[segmentIndex];
     animSegment.mFromComposite =
       static_cast<dom::CompositeOperation>(segment->startComposite());
     animSegment.mToComposite =
       static_cast<dom::CompositeOperation>(segment->endComposite());
 
     // interpolate the property
-    if (USE_STYLO_ON_COMPOSITOR) {
-      dom::IterationCompositeOperation iterCompositeOperation =
-          static_cast<dom::IterationCompositeOperation>(
-            animation.iterationComposite());
+#ifdef MOZ_STYLO
+    dom::IterationCompositeOperation iterCompositeOperation =
+        static_cast<dom::IterationCompositeOperation>(
+          animation.iterationComposite());
 
-      aAnimationValue.mServo =
-        Servo_ComposeAnimationSegment(
-          &animSegment,
-          aAnimationValue.mServo,
-          animData.mEndValues.LastElement().mServo,
-          iterCompositeOperation,
-          portion,
-          computedTiming.mCurrentIteration).Consume();
-    } else {
-      aAnimationValue.mGecko =
-        SampleValue(portion,
-                    animation,
-                    Move(animSegment),
-                    animData.mEndValues.LastElement().mGecko,
-                    computedTiming.mCurrentIteration,
-                    aAnimationValue.mGecko);
-    }
+    aAnimationValue.mServo =
+      Servo_ComposeAnimationSegment(
+        &animSegment,
+        aAnimationValue.mServo,
+        animData.mEndValues.LastElement().mServo,
+        iterCompositeOperation,
+        portion,
+        computedTiming.mCurrentIteration).Consume();
+#elif MOZ_OLD_STYLE
+    aAnimationValue.mGecko =
+      SampleValue(portion,
+                  animation,
+                  Move(animSegment),
+                  animData.mEndValues.LastElement().mGecko,
+                  computedTiming.mCurrentIteration,
+                  aAnimationValue.mGecko);
+#else
+    MOZ_CRASH("old style system disabled");
+#endif
     aHasInEffectAnimations = true;
   }
 
 #ifdef DEBUG
   // Sanity check that all of animation data are the same.
   const AnimationData& lastData = aAnimations.LastElement().data();
   for (const Animation& animation : aAnimations) {
     const AnimationData& data = animation.data();
@@ -472,19 +475,21 @@ CreateCSSValueList(const InfallibleTArra
     result->mValue.SetNoneValue();
   }
   return new nsCSSValueSharedList(result.forget());
 }
 
 static AnimationValue
 ToAnimationValue(const Animatable& aAnimatable)
 {
-  StyleBackendType backend = USE_STYLO_ON_COMPOSITOR
-                             ? StyleBackendType::Servo
-                             : StyleBackendType::Gecko;
+#ifdef MOZ_STYLO
+  StyleBackendType backend = StyleBackendType::Servo;
+#else
+  StyleBackendType backend = StyleBackendType::Gecko;
+#endif
   AnimationValue result;
 
   switch (aAnimatable.type()) {
     case Animatable::Tnull_t:
       break;
     case Animatable::TArrayOfTransformFunction: {
         const InfallibleTArray<TransformFunction>& transforms =
           aAnimatable.get_ArrayOfTransformFunction();
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -480,19 +480,23 @@ SetAnimatable(nsCSSPropertyID aProperty,
       break;
     case eCSSProperty_transform: {
       aAnimatable = InfallibleTArray<TransformFunction>();
       if (aAnimationValue.mServo) {
         RefPtr<nsCSSValueSharedList> list;
         Servo_AnimationValue_GetTransform(aAnimationValue.mServo, &list);
         AddTransformFunctions(list, aFrame, aRefBox, aAnimatable);
       } else {
+#ifdef MOZ_OLD_STYLE
         nsCSSValueSharedList* list =
           aAnimationValue.mGecko.GetCSSValueSharedListValue();
         AddTransformFunctions(list, aFrame, aRefBox, aAnimatable);
+#else
+        MOZ_CRASH("old style system disabled");
+#endif
       }
       break;
     }
     default:
       MOZ_ASSERT_UNREACHABLE("Unsupported property");
   }
 }
 
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -48,16 +48,17 @@
 
 using namespace mozilla;
 using namespace mozilla::css;
 using namespace mozilla::gfx;
 using nsStyleTransformMatrix::Decompose2DMatrix;
 using nsStyleTransformMatrix::Decompose3DMatrix;
 using nsStyleTransformMatrix::ShearType;
 
+#ifdef MOZ_OLD_STYLE
 // HELPER METHODS
 // --------------
 /*
  * Given two units, this method returns a common unit that they can both be
  * converted into, if possible.  This is intended to facilitate
  * interpolation, distance-computation, and addition between "similar" units.
  *
  * The ordering of the arguments should not affect the output of this method.
@@ -187,16 +188,17 @@ TransformFunctionListsMatch(const nsCSSV
 
     item1 = item1->mNext;
     item2 = item2->mNext;
   } while (item1 && item2);
 
   // Length match?
   return !item1 && !item2;
 }
+#endif
 
 static already_AddRefed<nsCSSValue::Array>
 AppendFunction(nsCSSKeyword aTransformFunction)
 {
   uint32_t nargs;
   switch (aTransformFunction) {
     case eCSSKeyword_matrix3d:
       nargs = 16;
@@ -239,16 +241,17 @@ AppendFunction(nsCSSKeyword aTransformFu
   }
 
   RefPtr<nsCSSValue::Array> arr = nsCSSValue::Array::Create(nargs + 1);
   arr->Item(0).SetIntValue(aTransformFunction, eCSSUnit_Enumerated);
 
   return arr.forget();
 }
 
+#ifdef MOZ_OLD_STYLE
 static already_AddRefed<nsCSSValue::Array>
 ToPrimitive(nsCSSValue::Array* aArray)
 {
   nsCSSKeyword tfunc = nsStyleTransformMatrix::TransformFunctionOf(aArray);
   nsCSSKeyword primitive = ToPrimitive(tfunc);
   RefPtr<nsCSSValue::Array> arr = AppendFunction(primitive);
 
   // FIXME: This would produce fewer calc() expressions if the
@@ -325,17 +328,16 @@ ToPrimitive(nsCSSValue::Array* aArray)
       break;
     }
     default:
       arr = aArray;
   }
   return arr.forget();
 }
 
-#ifdef MOZ_OLD_STYLE
 static void
 AppendCSSShadowValue(const nsCSSShadowItem *aShadow,
                      nsCSSValueList **&aResultTail,
                      nsCSSPropertyID aProperty)
 {
   MOZ_ASSERT(aShadow, "shadow expected");
 
   // X, Y, Radius, Spread, Color, Inset
@@ -353,17 +355,16 @@ AppendCSSShadowValue(const nsCSSShadowIt
     arr->Item(5).SetEnumValue(StyleBoxShadowType::Inset);
   }
 
   nsCSSValueList *resultItem = new nsCSSValueList;
   resultItem->mValue.SetArrayValue(arr, eCSSUnit_Array);
   *aResultTail = resultItem;
   aResultTail = &resultItem->mNext;
 }
-#endif
 
 // Like nsStyleCoord::CalcValue, but with length in float pixels instead
 // of nscoord.
 struct PixelCalcValue
 {
   float mLength, mPercent;
   bool mHasPercent;
 };
@@ -436,23 +437,21 @@ ExtractCalcValue(const nsCSSValue& aValu
     result.mLength = 0.0f;
     result.mPercent = aValue.GetPercentValue();
     result.mHasPercent = true;
     return result;
   }
   return ExtractCalcValueInternal(aValue);
 }
 
-#ifdef MOZ_OLD_STYLE
 static void
 CalcValueToCSSValue(const nsStyleCoord::CalcValue* aCalc, nsCSSValue& aValue)
 {
   aValue.SetCalcValue(aCalc);
 }
-#endif
 
 static void
 CalcValueToCSSValue(const PixelCalcValue& aCalc, nsCSSValue& aValue)
 {
   RefPtr<nsCSSValue::Array> arr = nsCSSValue::Array::Create(1);
   if (!aCalc.mHasPercent) {
     arr->Item(0).SetFloatValue(aCalc.mLength, eCSSUnit_Pixel);
   } else {
@@ -889,17 +888,16 @@ enum class ColorAdditionType {
 static UniquePtr<nsCSSValueList>
 AddWeightedFilterFunction(double aCoeff1, const nsCSSValueList* aList1,
                           double aCoeff2, const nsCSSValueList* aList2,
                           ColorAdditionType aColorAdditionType);
 
 static inline float
 GetNumberOrPercent(const nsCSSValue &aValue);
 
-#ifdef MOZ_OLD_STYLE
 static bool
 ComputeSingleShadowSquareDistance(const nsCSSValueList* aShadow1,
                                   const nsCSSValueList* aShadow2,
                                   double& aSquareDistance,
                                   nsCSSPropertyID aProperty)
 {
   MOZ_ASSERT(aShadow1->mValue.GetUnit() == eCSSUnit_Array, "wrong unit");
   MOZ_ASSERT(aShadow2->mValue.GetUnit() == eCSSUnit_Array, "wrong unit");
@@ -1078,30 +1076,28 @@ ComputeFilterListDistance(const nsCSSVal
       aList1 = aList1->mNext;
       aList2 = aList2->mNext;
     }
     squareDistance += currentSquareDistance;
   }
   aDistance = sqrt(squareDistance);
   return true;
 }
-#endif
 
 enum class Restrictions {
   Enable,
   Disable
 };
 
 static already_AddRefed<nsCSSValue::Array>
 AddShapeFunction(nsCSSPropertyID aProperty,
                  double aCoeff1, const nsCSSValue::Array* aArray1,
                  double aCoeff2, const nsCSSValue::Array* aArray2,
                  Restrictions aRestriction = Restrictions::Enable);
 
-#ifdef MOZ_OLD_STYLE
 static bool
 ComputeShapeDistance(nsCSSPropertyID aProperty,
                      const nsCSSValue::Array* aArray1,
                      const nsCSSValue::Array* aArray2,
                      double& aDistance)
 {
   // Use AddShapeFunction to get the difference between two shape functions.
   RefPtr<nsCSSValue::Array> diffShape =
@@ -1168,24 +1164,22 @@ ComputeShapeDistance(nsCSSPropertyID aPr
       break;
     }
     default:
       MOZ_ASSERT_UNREACHABLE("Unknown shape type");
   }
   aDistance = sqrt(squareDistance);
   return true;
 }
-#endif
 
 static nsCSSValueList*
 AddTransformLists(double aCoeff1, const nsCSSValueList* aList1,
                   double aCoeff2, const nsCSSValueList* aList2,
                   nsCSSKeyword aOperatorType = eCSSKeyword_interpolatematrix);
 
-#ifdef MOZ_OLD_STYLE
 static double
 ComputeTransform2DMatrixDistance(const Matrix& aMatrix1,
                                  const Matrix& aMatrix2)
 {
   Point3D scale1(1, 1, 1);
   Point3D translate1;
   gfxQuaternion rotate1;
   nsStyleTransformMatrix::ShearArray shear1{0.0f, 0.0f, 0.0f};
@@ -1962,17 +1956,16 @@ StyleAnimationValue::ComputeDistance(nsC
       aDistance = sqrt(squareDistance);
       return true;
     }
   }
 
   MOZ_ASSERT(false, "Can't compute distance using the given common unit");
   return false;
 }
-#endif
 
 static inline void
 AddCSSValueNumber(double aCoeff1, const nsCSSValue &aValue1,
                   double aCoeff2, const nsCSSValue &aValue2,
                   nsCSSValue &aResult, uint32_t aValueRestrictions = 0)
 {
   MOZ_ASSERT(aValue1.GetUnit() == eCSSUnit_Number, "unexpected unit");
   MOZ_ASSERT(aValue2.GetUnit() == eCSSUnit_Number, "unexpected unit");
@@ -3421,17 +3414,16 @@ StyleAnimationValue::Accumulate(nsCSSPro
                             1.0, result,
                             aCount, aA,
                             result);
       break;
   }
   return result;
 }
 
-#ifdef MOZ_OLD_STYLE
 already_AddRefed<css::StyleRule>
 BuildStyleRule(nsCSSPropertyID aProperty,
                dom::Element* aTargetElement,
                const nsAString& aSpecifiedValue,
                bool aUseSVGMode)
 {
   // Set up an empty CSS Declaration
   RefPtr<css::Declaration> declaration(new css::Declaration());
@@ -3693,17 +3685,16 @@ StyleAnimationValue::ComputeValues(
     bool aUseSVGMode,
     nsTArray<PropertyStyleAnimationValuePair>& aResult)
 {
   return ComputeValuesFromSpecifiedValue(aProperty, aEnabledState,
                                          aTargetElement, aStyleContext,
                                          aSpecifiedValue, aUseSVGMode,
                                          aResult);
 }
-#endif
 
 bool
 StyleAnimationValue::UncomputeValue(nsCSSPropertyID aProperty,
                                     const StyleAnimationValue& aComputedValue,
                                     nsCSSValue& aSpecifiedValue)
 {
   Unit unit = aComputedValue.GetUnit();
   switch (unit) {
@@ -3880,17 +3871,16 @@ StyleAnimationValue::UncomputeValue(nsCS
 template<typename T>
 inline const T&
 StyleDataAtOffset(const void* aStyleStruct, ptrdiff_t aOffset)
 {
   return *reinterpret_cast<const T*>(
     reinterpret_cast<const uint8_t*>(aStyleStruct) + aOffset);
 }
 
-#ifdef MOZ_OLD_STYLE
 static bool
 StyleCoordToValue(const nsStyleCoord& aCoord, StyleAnimationValue& aValue)
 {
   switch (aCoord.GetUnit()) {
     case eStyleUnit_Normal:
       aValue.SetNormalValue();
       break;
     case eStyleUnit_Auto:
@@ -4907,17 +4897,16 @@ StyleAnimationValue::ExtractComputedValu
                                               eUnit_DiscreteCSSValue);
       return true;
     }
     case eStyleAnimType_None:
       NS_NOTREACHED("shouldn't use on non-animatable properties");
   }
   return false;
 }
-#endif
 
 Size
 StyleAnimationValue::GetScaleValue(const nsIFrame* aForFrame) const
 {
   MOZ_ASSERT(GetUnit() == StyleAnimationValue::eUnit_Transform);
 
   nsCSSValueSharedList* list = GetCSSValueSharedListValue();
   return nsStyleTransformMatrix::GetScaleValue(list, aForFrame);
@@ -5329,130 +5318,189 @@ StyleAnimationValue::operator==(const St
                         aOther.GetStringBufferValue()) == 0);
     case eUnit_ComplexColor:
       return *mValue.mComplexColor == *aOther.mValue.mComplexColor;
   }
 
   NS_NOTREACHED("incomplete case");
   return false;
 }
+#endif
 
 
 // AnimationValue Implementation
 
 bool
 AnimationValue::operator==(const AnimationValue& aOther) const
 {
+#ifdef MOZ_OLD_STYLE
   // It is possible to compare an empty AnimationValue with others, so both
   // mServo and mGecko could be null while comparing.
   MOZ_ASSERT(!mServo || mGecko.IsNull());
+#endif
   if (mServo && aOther.mServo) {
     return Servo_AnimationValue_DeepEqual(mServo, aOther.mServo);
   }
-  return !mServo && !aOther.mServo &&
-         mGecko == aOther.mGecko;
+  if (!mServo && !aOther.mServo) {
+#ifdef MOZ_OLD_STYLE
+    return mGecko == aOther.mGecko;
+#else
+    return true;
+#endif
+  }
+  return false;
 }
 
 bool
 AnimationValue::operator!=(const AnimationValue& aOther) const
 {
   return !operator==(aOther);
 }
 
 float
 AnimationValue::GetOpacity() const
 {
+#ifdef MOZ_OLD_STYLE
   MOZ_ASSERT(!mServo != mGecko.IsNull());
   MOZ_ASSERT(mServo || mGecko.GetUnit() == StyleAnimationValue::eUnit_Float,
              "Should have the correct unit on Gecko backend");
-  return mServo ? Servo_AnimationValue_GetOpacity(mServo)
-                : mGecko.GetFloatValue();
+#else
+  MOZ_ASSERT(mServo);
+#endif
+  if (mServo) {
+    return Servo_AnimationValue_GetOpacity(mServo);
+  }
+#ifdef MOZ_OLD_STYLE
+  return mGecko.GetFloatValue();
+#else
+  MOZ_CRASH("old style system disabled");
+#endif
 }
 
 already_AddRefed<const nsCSSValueSharedList>
 AnimationValue::GetTransformList() const
 {
+#ifdef MOZ_OLD_STYLE
   MOZ_ASSERT(!mServo != mGecko.IsNull());
   MOZ_ASSERT(mServo || mGecko.GetUnit() == StyleAnimationValue::eUnit_Transform,
              "The unit of interpolated value for transform should be "
              "transform on Gecko backend");
+#else
+  MOZ_ASSERT(mServo);
+#endif
 
   RefPtr<nsCSSValueSharedList> transform;
   if (mServo) {
     Servo_AnimationValue_GetTransform(mServo, &transform);
   } else {
+#ifdef MOZ_OLD_STYLE
     transform = mGecko.GetCSSValueSharedListValue();
+#else
+    MOZ_CRASH("old style system disabled");
+#endif
   }
   return transform.forget();
 }
 
 Size
 AnimationValue::GetScaleValue(const nsIFrame* aFrame) const
 {
+#ifdef MOZ_OLD_STYLE
   MOZ_ASSERT(!mServo != mGecko.IsNull());
+#else
+  MOZ_ASSERT(mServo);
+#endif
+
   if (mServo) {
     RefPtr<nsCSSValueSharedList> list;
     Servo_AnimationValue_GetTransform(mServo, &list);
     return nsStyleTransformMatrix::GetScaleValue(list, aFrame);
   }
+#ifdef MOZ_OLD_STYLE
   return mGecko.GetScaleValue(aFrame);
+#else
+  MOZ_CRASH("old style system disabled");
+#endif
 }
 
 void
 AnimationValue::SerializeSpecifiedValue(nsCSSPropertyID aProperty,
                                         nsAString& aString) const
 {
+#ifdef MOZ_OLD_STYLE
   MOZ_ASSERT(!mServo != mGecko.IsNull());
+#else
+  MOZ_ASSERT(mServo);
+#endif
+
   if (mServo) {
     Servo_AnimationValue_Serialize(mServo, aProperty, &aString);
     return;
   }
 
+#ifdef MOZ_OLD_STYLE
   DebugOnly<bool> uncomputeResult =
     StyleAnimationValue::UncomputeValue(aProperty, mGecko, aString);
   MOZ_ASSERT(uncomputeResult, "failed to uncompute StyleAnimationValue");
+#else
+  MOZ_CRASH("old style system disabled");
+#endif
 }
 
 bool
 AnimationValue::IsInterpolableWith(nsCSSPropertyID aProperty,
                                    const AnimationValue& aToValue) const
 {
   if (IsNull() || aToValue.IsNull()) {
     return false;
   }
 
+#ifdef MOZ_OLD_STYLE
   MOZ_ASSERT(!mServo != mGecko.IsNull());
   MOZ_ASSERT(mGecko.IsNull() == aToValue.mGecko.IsNull() &&
              !mServo == !aToValue.mServo,
              "Animation values should have the same style engine");
+#else
+  MOZ_ASSERT(mServo);
+  MOZ_ASSERT(aToValue.mServo);
+#endif
 
   if (mServo) {
     return Servo_AnimationValues_IsInterpolable(mServo, aToValue.mServo);
   }
 
+#ifdef MOZ_OLD_STYLE
   // If this is ever a performance problem, we could add a
   // StyleAnimationValue::IsInterpolatable method, but it seems fine for now.
   StyleAnimationValue dummy;
   return StyleAnimationValue::Interpolate(
            aProperty, mGecko, aToValue.mGecko, 0.5, dummy);
+#else
+  MOZ_CRASH("old style system disabled");
+#endif
 }
 
 double
 AnimationValue::ComputeDistance(nsCSSPropertyID aProperty,
                                 const AnimationValue& aOther,
                                 nsStyleContext* aStyleContext) const
 {
   if (IsNull() || aOther.IsNull()) {
     return 0.0;
   }
 
+#ifdef MOZ_OLD_STYLE
   MOZ_ASSERT(!mServo != mGecko.IsNull());
   MOZ_ASSERT(mGecko.IsNull() == aOther.mGecko.IsNull() &&
              !mServo == !aOther.mServo,
              "Animation values should have the same style engine");
+#else
+  MOZ_ASSERT(mServo);
+  MOZ_ASSERT(aOther.mServo);
+#endif
 
   double distance= 0.0;
   if (mServo) {
     distance = Servo_AnimationValues_ComputeDistance(mServo, aOther.mServo);
     return distance < 0.0
            ? 0.0
            : distance;
   }
@@ -5534,17 +5582,21 @@ AnimationValue::Opacity(StyleBackendType
 {
   AnimationValue result;
 
   switch (aBackendType) {
     case StyleBackendType::Servo:
       result.mServo = Servo_AnimationValue_Opacity(aOpacity).Consume();
       break;
     case StyleBackendType::Gecko:
+#ifdef MOZ_OLD_STYLE
       result.mGecko.SetFloatValue(aOpacity);
+#else
+      MOZ_CRASH("old style system disabled");
+#endif
       break;
     default:
       MOZ_ASSERT_UNREACHABLE("Unsupported style backend");
   }
   return result;
 }
 
 /* static */ AnimationValue
@@ -5553,17 +5605,21 @@ AnimationValue::Transform(StyleBackendTy
 {
   AnimationValue result;
 
   switch (aBackendType) {
     case StyleBackendType::Servo:
       result.mServo = Servo_AnimationValue_Transform(aList).Consume();
       break;
     case StyleBackendType::Gecko:
+#ifdef MOZ_OLD_STYLE
       result.mGecko.SetTransformValue(&aList);
+#else
+      MOZ_CRASH("old style system disabled");
+#endif
       break;
     default:
       MOZ_ASSERT_UNREACHABLE("Unsupported style backend");
   }
   return result;
 }
 
 /* static */ already_AddRefed<nsCSSValue::Array>
--- a/layout/style/StyleAnimationValue.h
+++ b/layout/style/StyleAnimationValue.h
@@ -37,16 +37,17 @@ class StyleRule;
 namespace dom {
 class Element;
 } // namespace dom
 
 enum class CSSPseudoElementType : uint8_t;
 enum class StyleBackendType : uint8_t;
 struct PropertyStyleAnimationValuePair;
 
+#ifdef MOZ_OLD_STYLE
 /**
  * Utility class to handle animated style values
  */
 class StyleAnimationValue {
 public:
   // Mathematical methods
   // --------------------
   /**
@@ -83,17 +84,16 @@ public:
    *                    should be calculated.
    * @param aEndColor   The end of the interval for which the distance
    *                    should be calculated.
    * @return the result of the calculation.
    */
   static double ComputeColorDistance(const css::RGBAColorData& aStartColor,
                                      const css::RGBAColorData& aEndColor);
 
-#ifdef MOZ_OLD_STYLE
   /**
    * Calculates a measure of 'distance' between two values.
    *
    * This measure of Distance is guaranteed to be proportional to
    * portions passed to Interpolate, Add, or AddWeighted.  However, for
    * some types of StyleAnimationValue it may not produce sensible results
    * for paced animation.
    *
@@ -110,17 +110,16 @@ public:
    * @return true on success, false on failure.
    */
   static MOZ_MUST_USE bool
   ComputeDistance(nsCSSPropertyID aProperty,
                   const StyleAnimationValue& aStartValue,
                   const StyleAnimationValue& aEndValue,
                   GeckoStyleContext* aStyleContext,
                   double& aDistance);
-#endif
 
   /**
    * Calculates an interpolated value that is the specified |aPortion| between
    * the two given values.
    *
    * This really just does the following calculation:
    *   aResultValue = (1.0 - aPortion) * aStartValue + aPortion * aEndValue
    *
@@ -172,17 +171,16 @@ public:
   static StyleAnimationValue
   Accumulate(nsCSSPropertyID aProperty,
              const StyleAnimationValue& aA,
              StyleAnimationValue&& aB,
              uint64_t aCount = 1);
 
   // Type-conversion methods
   // -----------------------
-#ifdef MOZ_OLD_STYLE
   /**
    * Creates a computed value for the given specified value
    * (property ID + string).  A style context is needed in case the
    * specified value depends on inherited style or on the values of other
    * properties.
    *
    * @param aProperty       The property whose value we're computing.
    * @param aTargetElement  The content node to which our computed value is
@@ -243,17 +241,16 @@ public:
   static MOZ_MUST_USE bool
   ComputeValues(nsCSSPropertyID aProperty,
                 mozilla::CSSEnabledState aEnabledState,
                 mozilla::dom::Element* aTargetElement,
                 mozilla::GeckoStyleContext* aStyleContext,
                 const nsCSSValue& aSpecifiedValue,
                 bool aUseSVGMode,
                 nsTArray<PropertyStyleAnimationValuePair>& aResult);
-#endif
 
   /**
    * Creates a specified value for the given computed value.
    *
    * The first two overloads fill in an nsCSSValue object; the third
    * produces a string.  For the overload that takes a const
    * StyleAnimationValue& reference, the nsCSSValue result may depend on
    * objects owned by the |aComputedValue| object, so users of that variant
@@ -275,17 +272,16 @@ public:
   UncomputeValue(nsCSSPropertyID aProperty,
                  StyleAnimationValue&& aComputedValue,
                  nsCSSValue& aSpecifiedValue);
   static MOZ_MUST_USE bool
   UncomputeValue(nsCSSPropertyID aProperty,
                  const StyleAnimationValue& aComputedValue,
                  nsAString& aSpecifiedValue);
 
-#ifdef MOZ_OLD_STYLE
   /**
    * Gets the computed value for the given property from the given style
    * context.
    *
    * Obtaining the computed value allows us to animate properties when the
    * content author has specified a value like "inherit" or "initial" or some
    * other keyword that isn't directly interpolatable, but which *computes* to
    * something interpolatable.
@@ -294,17 +290,16 @@ public:
    * @param aStyleContext The style context to check for the computed value.
    * @param [out] aComputedValue The resulting computed value.
    * @return true on success, false on failure.
    */
   static MOZ_MUST_USE bool ExtractComputedValue(
     nsCSSPropertyID aProperty,
     mozilla::GeckoStyleContext* aStyleContext,
     StyleAnimationValue& aComputedValue);
-#endif
 
   /**
    * The types and values for the values that we extract and animate.
    */
   enum Unit {
     eUnit_Null, // not initialized
     eUnit_Normal,
     eUnit_Auto,
@@ -569,52 +564,76 @@ private:
   }
   static bool IsCSSValuePairListUnit(Unit aUnit) {
     return aUnit == eUnit_CSSValuePairList;
   }
   static bool IsStringUnit(Unit aUnit) {
     return aUnit == eUnit_UnparsedString;
   }
 };
+#endif
 
 struct AnimationValue
 {
+#ifdef MOZ_OLD_STYLE
   explicit AnimationValue(const StyleAnimationValue& aValue)
     : mGecko(aValue) { }
+#endif
   explicit AnimationValue(const RefPtr<RawServoAnimationValue>& aValue)
     : mServo(aValue) { }
   AnimationValue() = default;
 
   AnimationValue(const AnimationValue& aOther)
-    : mGecko(aOther.mGecko), mServo(aOther.mServo) { }
+#ifdef MOZ_OLD_STYLE
+    : mGecko(aOther.mGecko)
+    , mServo(aOther.mServo) { }
+#else
+    : mServo(aOther.mServo) { }
+#endif
   AnimationValue(AnimationValue&& aOther)
+#ifdef MOZ_OLD_STYLE
     : mGecko(Move(aOther.mGecko)), mServo(Move(aOther.mServo)) { }
+#else
+    : mServo(Move(aOther.mServo)) { }
+#endif
 
   AnimationValue& operator=(const AnimationValue& aOther)
   {
     if (this != &aOther) {
+#ifdef MOZ_OLD_STYLE
       mGecko = aOther.mGecko;
+#endif
       mServo = aOther.mServo;
     }
     return *this;
   }
   AnimationValue& operator=(AnimationValue&& aOther)
   {
     MOZ_ASSERT(this != &aOther, "Do not move itself");
     if (this != &aOther) {
+#ifdef MOZ_OLD_STYLE
       mGecko = Move(aOther.mGecko);
+#endif
       mServo = Move(aOther.mServo);
     }
     return *this;
   }
 
   bool operator==(const AnimationValue& aOther) const;
   bool operator!=(const AnimationValue& aOther) const;
 
-  bool IsNull() const { return mGecko.IsNull() && !mServo; }
+  bool IsNull() const
+  {
+#ifdef MOZ_OLD_STYLE
+    if (!mGecko.IsNull()) {
+      return false;
+    }
+#endif
+    return !mServo;
+  }
 
   float GetOpacity() const;
 
   // Return the transform list as a RefPtr.
   already_AddRefed<const nsCSSValueSharedList> GetTransformList() const;
 
   // Return the scale for mGecko or mServo, which are calculated with
   // reference to aFrame.
@@ -652,17 +671,25 @@ struct AnimationValue
   AppendTransformFunction(nsCSSKeyword aTransformFunction,
                           nsCSSValueList**& aListTail);
 
   // mGecko and mServo are mutually exclusive: only one or the other should
   // ever be set.
   // FIXME: After obsoleting StyleAnimationValue, we should remove mGecko, and
   // make AnimationValue a wrapper of RawServoAnimationValue to hide these
   // FFIs.
+#ifdef MOZ_OLD_STYLE
   StyleAnimationValue mGecko;
+#else
+  // Ideally we would use conditional compilation based on MOZ_OLD_STYLE in the
+  // Servo code that wants to initialize mGecko, but that seems tricky.  So for
+  // now, just define a dummy member variable that its initialization code will
+  // work on, even when the old style system is compiled out.
+  uintptr_t mGecko;
+#endif
   RefPtr<RawServoAnimationValue> mServo;
 };
 
 struct PropertyStyleAnimationValuePair
 {
   nsCSSPropertyID mProperty;
   AnimationValue mValue;
 };
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -131,30 +131,36 @@ ElementPropertyTransition::UpdateStartVa
         Servo_AnimationValues_Interpolate(replacedFrom.mServo,
                                           replacedTo.mServo,
                                           valuePosition).Consume();
       if (startValue.mServo) {
         mKeyframes[0].mPropertyValues[0].mServoDeclarationBlock =
           Servo_AnimationValue_Uncompute(startValue.mServo).Consume();
         mProperties[0].mSegments[0].mFromValue = Move(startValue);
       }
-    } else if (StyleAnimationValue::Interpolate(mProperties[0].mProperty,
+    } else {
+#ifdef MOZ_OLD_STYLE
+      if (StyleAnimationValue::Interpolate(mProperties[0].mProperty,
                                                 replacedFrom.mGecko,
                                                 replacedTo.mGecko,
                                                 valuePosition,
                                                 startValue.mGecko)) {
-      nsCSSValue cssValue;
-      DebugOnly<bool> uncomputeResult =
-        StyleAnimationValue::UncomputeValue(mProperties[0].mProperty,
-                                            startValue.mGecko,
-                                            cssValue);
-      MOZ_ASSERT(uncomputeResult, "UncomputeValue should not fail");
-      mKeyframes[0].mPropertyValues[0].mValue = cssValue;
+        nsCSSValue cssValue;
+        DebugOnly<bool> uncomputeResult =
+          StyleAnimationValue::UncomputeValue(mProperties[0].mProperty,
+                                              startValue.mGecko,
+                                              cssValue);
+        MOZ_ASSERT(uncomputeResult, "UncomputeValue should not fail");
+        mKeyframes[0].mPropertyValues[0].mValue = cssValue;
 
-      mProperties[0].mSegments[0].mFromValue = Move(startValue);
+        mProperties[0].mSegments[0].mFromValue = Move(startValue);
+      }
+#else
+      MOZ_CRASH("old style system disabled");
+#endif
     }
   }
 
   mReplacedTransition.reset();
 }
 
 ////////////////////////// CSSTransition ////////////////////////////
 
@@ -812,24 +818,28 @@ AppendKeyframe(double aOffset,
   frame.mOffset.emplace(aOffset);
 
   if (aValue.mServo) {
     RefPtr<RawServoDeclarationBlock> decl =
       Servo_AnimationValue_Uncompute(aValue.mServo).Consume();
     frame.mPropertyValues.AppendElement(
       Move(PropertyValuePair(aProperty, Move(decl))));
   } else {
+#ifdef MOZ_OLD_STYLE
     nsCSSValue propertyValue;
     DebugOnly<bool> uncomputeResult =
       StyleAnimationValue::UncomputeValue(aProperty, Move(aValue.mGecko),
                                           propertyValue);
     MOZ_ASSERT(uncomputeResult,
                "Unable to get specified value from computed value");
     frame.mPropertyValues.AppendElement(
       Move(PropertyValuePair(aProperty, Move(propertyValue))));
+#else
+    MOZ_CRASH("old style system disabled");
+#endif
   }
   return frame;
 }
 
 static nsTArray<Keyframe>
 GetTransitionKeyframes(nsCSSPropertyID aProperty,
                        AnimationValue&& aStartValue,
                        AnimationValue&& aEndValue,