Bug 1447358: Unifdef the old style system code. r=jwatt
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 20 Mar 2018 18:04:19 +0100
changeset 409248 8e5206684eea8da76d938de3c02c3e8c240e7c9b
parent 409247 83e91da1cdeef25e81f23de8c883948c58d248e6
child 409249 828a0bf882b7833ff2053252f5ad48ce533be4a2
push id33681
push useraiakab@mozilla.com
push dateWed, 21 Mar 2018 19:13:51 +0000
treeherdermozilla-central@3aa5d0714638 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1447358
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1447358: Unifdef the old style system code. r=jwatt Summary: This has been automatically generated using: http://dotat.at/prog/unifdef/ And: find $OBJDIR -type f -name '*.h' | while read FILE; do echo "$FILE" unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE"; done find $OBJDIR -type f -name '*.cpp' | while read FILE; do echo "$FILE" unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE"; done MozReview-Commit-ID: I4NdKqbMXzJ Reviewers: jwatt Bug #: 1447358 Differential Revision: https://phabricator.services.mozilla.com/D779
dom/animation/Animation.cpp
dom/animation/EffectCompositor.cpp
dom/animation/EffectCompositor.h
dom/animation/EffectSet.h
dom/animation/KeyframeEffectReadOnly.cpp
dom/animation/KeyframeEffectReadOnly.h
dom/animation/KeyframeUtils.cpp
dom/animation/TimingParams.cpp
dom/base/DOMIntersectionObserver.cpp
dom/base/DOMMatrix.cpp
dom/base/Element.cpp
dom/base/Element.h
dom/base/FragmentOrElement.cpp
dom/base/ResponsiveImageSelector.cpp
dom/base/ResponsiveImageSelector.h
dom/base/StyleSheetList.cpp
dom/base/nsAttrAndChildArray.cpp
dom/base/nsAttrAndChildArray.h
dom/base/nsAttrValue.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsDocument.cpp
dom/base/nsIDocument.h
dom/base/nsINode.cpp
dom/base/nsINode.h
dom/base/nsMappedAttributeElement.cpp
dom/base/nsMappedAttributeElement.h
dom/base/nsMappedAttributes.cpp
dom/base/nsMappedAttributes.h
dom/base/nsTreeSanitizer.cpp
dom/base/nsTreeSanitizer.h
dom/canvas/CanvasRenderingContext2D.cpp
dom/html/HTMLBodyElement.cpp
dom/html/HTMLBodyElement.h
dom/html/HTMLHRElement.h
dom/html/HTMLOptionsCollection.cpp
dom/html/HTMLSpanElement.h
dom/html/HTMLTableCellElement.cpp
dom/html/HTMLTableCellElement.h
dom/html/HTMLTrackElement.cpp
dom/html/nsGenericHTMLElement.cpp
dom/ipc/ContentParent.cpp
dom/mathml/nsMathMLElement.cpp
dom/smil/nsSMILCSSProperty.cpp
dom/smil/nsSMILCSSValueType.cpp
dom/svg/nsSVGElement.cpp
dom/svg/nsSVGElement.h
dom/xbl/nsBindingManager.cpp
dom/xbl/nsBindingManager.h
dom/xbl/nsXBLBinding.cpp
dom/xbl/nsXBLBinding.h
dom/xbl/nsXBLPrototypeBinding.cpp
dom/xbl/nsXBLPrototypeBinding.h
dom/xbl/nsXBLPrototypeResources.cpp
dom/xbl/nsXBLPrototypeResources.h
dom/xbl/nsXBLResourceLoader.cpp
dom/xul/nsXULElement.cpp
dom/xul/nsXULElement.h
editor/libeditor/CSSEditUtils.cpp
editor/libeditor/HTMLEditor.cpp
gfx/layers/AnimationHelper.cpp
gfx/layers/apz/util/ActiveElementManager.cpp
layout/base/PresShell.cpp
layout/base/PresShell.h
layout/base/RestyleLogging.h
layout/base/RestyleManager.cpp
layout/base/RestyleManagerInlines.h
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/base/nsDocumentViewer.cpp
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/base/nsPresArena.cpp
layout/base/nsPresContext.cpp
layout/base/nsRefreshDriver.cpp
layout/base/nsStyleSheetService.cpp
layout/base/nsStyleSheetService.h
layout/build/nsLayoutModule.cpp
layout/build/nsLayoutStatics.cpp
layout/forms/nsMeterFrame.cpp
layout/forms/nsNumberControlFrame.cpp
layout/forms/nsProgressFrame.cpp
layout/generic/nsFirstLetterFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsGridContainerFrame.cpp
layout/inspector/InspectorFontFace.cpp
layout/inspector/InspectorUtils.cpp
layout/mathml/nsMathMLTokenFrame.cpp
layout/painting/nsDisplayList.cpp
layout/style/AnimationCollection.cpp
layout/style/AnimationCollection.h
layout/style/CSS.cpp
layout/style/CSSKeyframesRule.cpp
layout/style/CSSKeyframesRule.h
layout/style/CSSStyleSheet.cpp
layout/style/CounterStyleManager.cpp
layout/style/DeclarationBlockInlines.h
layout/style/FontFace.cpp
layout/style/FontFaceSet.cpp
layout/style/GenericSpecifiedValuesInlines.h
layout/style/GroupRule.cpp
layout/style/GroupRule.h
layout/style/Loader.cpp
layout/style/Loader.h
layout/style/MediaList.cpp
layout/style/RuleNodeCacheConditions.h
layout/style/ServoBindings.cpp
layout/style/ServoDocumentRule.cpp
layout/style/ServoDocumentRule.h
layout/style/ServoMediaRule.cpp
layout/style/ServoMediaRule.h
layout/style/ServoStyleContext.cpp
layout/style/ServoStyleSet.cpp
layout/style/ServoSupportsRule.cpp
layout/style/ServoSupportsRule.h
layout/style/ServoUtils.h
layout/style/StyleAnimationValue.cpp
layout/style/StyleAnimationValue.h
layout/style/StyleRule.h
layout/style/StyleSetHandle.h
layout/style/StyleSetHandleInlines.h
layout/style/StyleSheet.cpp
layout/style/StyleSheetInlines.h
layout/style/nsAnimationManager.cpp
layout/style/nsAnimationManager.h
layout/style/nsCSSCounterStyleRule.cpp
layout/style/nsCSSParser.h
layout/style/nsCSSValue.cpp
layout/style/nsComputedDOMStyle.cpp
layout/style/nsDOMCSSAttrDeclaration.cpp
layout/style/nsDOMCSSDeclaration.cpp
layout/style/nsFontFaceLoader.h
layout/style/nsHTMLCSSStyleSheet.cpp
layout/style/nsHTMLCSSStyleSheet.h
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsHTMLStyleSheet.h
layout/style/nsLayoutStylesheetCache.cpp
layout/style/nsMediaFeatures.cpp
layout/style/nsRuleProcessorData.h
layout/style/nsStyleContext.cpp
layout/style/nsStyleContext.h
layout/style/nsStyleContextInlines.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
layout/style/nsStyleTransformMatrix.cpp
layout/style/nsTransitionManager.cpp
layout/style/nsTransitionManager.h
layout/style/test/gtest/StyloParsingBench.cpp
layout/svg/nsCSSClipPathInstance.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/tables/nsTableColGroupFrame.cpp
layout/xul/nsSplitterFrame.cpp
layout/xul/tree/nsTreeBodyFrame.cpp
layout/xul/tree/nsTreeStyleCache.cpp
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -1652,23 +1652,16 @@ Animation::DispatchPlaybackEvent(const n
 bool
 Animation::IsRunningOnCompositor() const
 {
   return mEffect &&
          mEffect->AsKeyframeEffect() &&
          mEffect->AsKeyframeEffect()->IsRunningOnCompositor();
 }
 
-#ifdef MOZ_OLD_STYLE
-template
-void
-Animation::ComposeStyle<RefPtr<AnimValuesStyleRule>&>(
-  RefPtr<AnimValuesStyleRule>& aAnimationRule,
-  const nsCSSPropertyIDSet& aPropertiesToSkip);
-#endif
 
 template
 void
 Animation::ComposeStyle<RawServoAnimationValueMap&>(
   RawServoAnimationValueMap& aAnimationValues,
   const nsCSSPropertyIDSet& aPropertiesToSkip);
 
 } // namespace dom
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -13,38 +13,31 @@
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/KeyframeEffectReadOnly.h"
 #include "mozilla/AnimationComparator.h"
 #include "mozilla/AnimationPerformanceWarning.h"
 #include "mozilla/AnimationTarget.h"
 #include "mozilla/AnimationUtils.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/EffectSet.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoStyleContext.h"
-#endif
 #include "mozilla/LayerAnimationInfo.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/RestyleManagerInlines.h"
 #include "mozilla/ServoBindings.h" // Servo_GetProperties_Overriding_Animation
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/TypeTraits.h" // For Forward<>
 #include "nsContentUtils.h"
 #include "nsCSSPseudoElements.h"
 #include "nsCSSPropertyIDSet.h"
 #include "nsCSSProps.h"
 #include "nsAtom.h"
 #include "nsIPresShell.h"
 #include "nsIPresShellInlines.h"
 #include "nsLayoutUtils.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleNode.h" // For nsRuleNode::ComputePropertiesOverridingAnimation
-#include "nsRuleProcessorData.h" // For ElementRuleProcessorData etc.
-#endif
 #include "nsStyleContextInlines.h"
 #include "nsTArray.h"
 #include "PendingAnimationTracker.h"
 
 using mozilla::dom::Animation;
 using mozilla::dom::Element;
 using mozilla::dom::KeyframeEffectReadOnly;
 
@@ -410,91 +403,16 @@ EffectCompositor::UpdateEffectProperties
   // result.
   effectSet->MarkCascadeNeedsUpdate();
 
   for (KeyframeEffectReadOnly* effect : *effectSet) {
     effect->UpdateProperties(aStyleType);
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-EffectCompositor::MaybeUpdateAnimationRule(dom::Element* aElement,
-                                           CSSPseudoElementType aPseudoType,
-                                           CascadeLevel aCascadeLevel,
-                                           nsStyleContext* aStyleContext)
-{
-  // First update cascade results since that may cause some elements to
-  // be marked as needing a restyle.
-  MaybeUpdateCascadeResults(StyleBackendType::Gecko,
-                            aElement, aPseudoType,
-                            aStyleContext);
-
-  auto& elementsToRestyle = mElementsToRestyle[aCascadeLevel];
-  PseudoElementHashEntry::KeyType key = { aElement, aPseudoType };
-
-  if (!elementsToRestyle.Contains(key)) {
-    return;
-  }
-
-  ComposeAnimationRule(aElement, aPseudoType, aCascadeLevel);
-
-  elementsToRestyle.Remove(key);
-}
-
-nsIStyleRule*
-EffectCompositor::GetAnimationRule(dom::Element* aElement,
-                                   CSSPseudoElementType aPseudoType,
-                                   CascadeLevel aCascadeLevel,
-                                   nsStyleContext* aStyleContext)
-{
-  // NOTE: We need to be careful about early returns in this method where
-  // we *don't* update mElementsToRestyle. When we get a call to
-  // RequestRestyle that results in a call to PostRestyleForAnimation, we
-  // will set a bool flag in mElementsToRestyle indicating that we've
-  // called PostRestyleForAnimation so we don't need to call it again
-  // until that restyle happens. During that restyle, if we arrive here
-  // and *don't* update mElementsToRestyle we'll continue to skip calling
-  // PostRestyleForAnimation from RequestRestyle.
-
-  if (!mPresContext || !mPresContext->IsDynamic()) {
-    // For print or print preview, ignore animations.
-    return nullptr;
-  }
-
-  MOZ_ASSERT(mPresContext->RestyleManager()->IsGecko(),
-             "stylo: Servo-backed style system should not be using "
-             "EffectCompositor");
-  if (mPresContext->RestyleManager()->AsGecko()->SkipAnimationRules()) {
-    // We don't need to worry about updating mElementsToRestyle in this case
-    // since this is not the animation restyle we requested when we called
-    // PostRestyleForAnimation (see comment at start of this method).
-    return nullptr;
-  }
-
-  MaybeUpdateAnimationRule(aElement, aPseudoType, aCascadeLevel, aStyleContext);
-
-#ifdef DEBUG
-  {
-    auto& elementsToRestyle = mElementsToRestyle[aCascadeLevel];
-    PseudoElementHashEntry::KeyType key = { aElement, aPseudoType };
-    MOZ_ASSERT(!elementsToRestyle.Contains(key),
-               "Element should no longer require a restyle after its "
-               "animation rule has been updated");
-  }
-#endif
-
-  EffectSet* effectSet = EffectSet::GetEffectSet(aElement, aPseudoType);
-  if (!effectSet) {
-    return nullptr;
-  }
-
-  return effectSet->AnimationRule(aCascadeLevel);
-}
-#endif
 
 namespace {
   class EffectCompositeOrderComparator {
   public:
     bool Equals(const KeyframeEffectReadOnly* a,
                 const KeyframeEffectReadOnly* b) const
     {
       return a == b;
@@ -585,83 +503,16 @@ EffectCompositor::HasPendingStyleUpdates
     if (elementSet.Count()) {
       return true;
     }
   }
 
   return false;
 }
 
-#ifdef MOZ_OLD_STYLE
-bool
-EffectCompositor::HasThrottledStyleUpdates() const
-{
-  for (auto& elementSet : mElementsToRestyle) {
-    for (auto iter = elementSet.ConstIter(); !iter.Done(); iter.Next()) {
-      if (!iter.Data()) {
-        return true;
-      }
-    }
-  }
-
-  return false;
-}
-
-void
-EffectCompositor::AddStyleUpdatesTo(RestyleTracker& aTracker)
-{
-  if (!mPresContext) {
-    return;
-  }
-
-  for (size_t i = 0; i < kCascadeLevelCount; i++) {
-    CascadeLevel cascadeLevel = CascadeLevel(i);
-    auto& elementSet = mElementsToRestyle[cascadeLevel];
-
-    // Copy the list of elements to restyle to a separate array that we can
-    // iterate over. This is because we need to call MaybeUpdateCascadeResults
-    // on each element, but doing that can mutate elementSet. In this case
-    // it will only mutate the bool value associated with each element in the
-    // set but even doing that will cause assertions in PLDHashTable to fail
-    // if we are iterating over the hashtable at the same time.
-    nsTArray<PseudoElementHashEntry::KeyType> elementsToRestyle(
-      elementSet.Count());
-    for (auto iter = elementSet.Iter(); !iter.Done(); iter.Next()) {
-      // Skip animations on elements that have been orphaned since they
-      // requested a restyle.
-      if (iter.Key().mElement->IsInComposedDoc()) {
-        elementsToRestyle.AppendElement(iter.Key());
-      }
-    }
-
-    for (auto& pseudoElem : elementsToRestyle) {
-      MaybeUpdateCascadeResults(StyleBackendType::Gecko,
-                                pseudoElem.mElement,
-                                pseudoElem.mPseudoType,
-                                nullptr);
-
-      ComposeAnimationRule(pseudoElem.mElement,
-                           pseudoElem.mPseudoType,
-                           cascadeLevel);
-
-      dom::Element* elementToRestyle =
-        GetElementToRestyle(pseudoElem.mElement, pseudoElem.mPseudoType);
-      if (elementToRestyle) {
-        nsRestyleHint rshint = cascadeLevel == CascadeLevel::Transitions ?
-                               eRestyle_CSSTransitions :
-                               eRestyle_CSSAnimations;
-        aTracker.AddPendingRestyle(elementToRestyle, rshint, nsChangeHint(0));
-      }
-    }
-
-    elementSet.Clear();
-    // Note: mElement pointers in elementsToRestyle might now dangle
-  }
-}
-#endif
 
 /* static */ bool
 EffectCompositor::HasAnimationsForCompositor(const nsIFrame* aFrame,
                                              nsCSSPropertyID aProperty)
 {
   return FindAnimationsForCompositor(aFrame, aProperty, nullptr);
 }
 
@@ -744,87 +595,33 @@ EffectCompositor::GetAnimationElementAnd
     return result;
   }
 
   result.emplace(content->AsElement(), pseudoType);
 
   return result;
 }
 
-#ifdef MOZ_OLD_STYLE
-/* static */ void
-EffectCompositor::ComposeAnimationRule(dom::Element* aElement,
-                                       CSSPseudoElementType aPseudoType,
-                                       CascadeLevel aCascadeLevel)
-{
-  EffectSet* effects = EffectSet::GetEffectSet(aElement, aPseudoType);
-  if (!effects) {
-    return;
-  }
-
-  // The caller is responsible for calling MaybeUpdateCascadeResults first.
-  MOZ_ASSERT(!effects->CascadeNeedsUpdate(),
-             "Animation cascade out of date when composing animation rule");
-
-  // Get a list of effects sorted by composite order.
-  nsTArray<KeyframeEffectReadOnly*> sortedEffectList(effects->Count());
-  for (KeyframeEffectReadOnly* effect : *effects) {
-    sortedEffectList.AppendElement(effect);
-  }
-  sortedEffectList.Sort(EffectCompositeOrderComparator());
-
-  RefPtr<AnimValuesStyleRule>& animRule = effects->AnimationRule(aCascadeLevel);
-  animRule = nullptr;
-
-  // If multiple animations affect the same property, animations with higher
-  // composite order (priority) override or add or animations with lower
-  // priority except properties in propertiesToSkip.
-  const nsCSSPropertyIDSet& propertiesToSkip =
-    aCascadeLevel == CascadeLevel::Animations
-    ? effects->PropertiesForAnimationsLevel().Inverse()
-    : effects->PropertiesForAnimationsLevel();
-  for (KeyframeEffectReadOnly* effect : sortedEffectList) {
-    effect->GetAnimation()->WillComposeStyle();
-    effect->GetAnimation()->ComposeStyle(animRule, propertiesToSkip);
-  }
-
-  MOZ_ASSERT(effects == EffectSet::GetEffectSet(aElement, aPseudoType),
-             "EffectSet should not change while composing style");
-}
-#endif
 
 /* static */ nsCSSPropertyIDSet
 EffectCompositor::GetOverriddenProperties(StyleBackendType aBackendType,
                                           EffectSet& aEffectSet,
                                           Element* aElement,
                                           CSSPseudoElementType aPseudoType,
                                           nsStyleContext* aStyleContext)
 {
   MOZ_ASSERT(aBackendType != StyleBackendType::Servo || aElement,
              "Should have an element to get style data from if we are using"
              " the Servo backend");
 
   nsCSSPropertyIDSet result;
 
   Element* elementToRestyle = GetElementToRestyle(aElement, aPseudoType);
   if (aBackendType == StyleBackendType::Gecko && !aStyleContext) {
-#ifdef MOZ_OLD_STYLE
-    if (elementToRestyle) {
-      nsIFrame* frame = elementToRestyle->GetPrimaryFrame();
-      if (frame) {
-        aStyleContext = frame->StyleContext();
-      }
-    }
-
-    if (!aStyleContext) {
-      return result;
-    }
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   } else if (aBackendType == StyleBackendType::Servo && !elementToRestyle) {
     return result;
   }
 
   AutoTArray<nsCSSPropertyID, LayerAnimationInfo::kRecords> propertiesToTrack;
   {
     nsCSSPropertyIDSet propertiesToTrackAsSet;
     for (KeyframeEffectReadOnly* effect : aEffectSet) {
@@ -850,23 +647,17 @@ EffectCompositor::GetOverriddenPropertie
 
   switch (aBackendType) {
     case StyleBackendType::Servo:
       Servo_GetProperties_Overriding_Animation(elementToRestyle,
                                                &propertiesToTrack,
                                                &result);
       break;
     case StyleBackendType::Gecko:
-#ifdef MOZ_OLD_STYLE
-      nsRuleNode::ComputePropertiesOverridingAnimation(propertiesToTrack,
-                                                       aStyleContext->AsGecko(),
-                                                       result);
-#else
       MOZ_CRASH("old style system disabled");
-#endif
       break;
 
     default:
       MOZ_ASSERT_UNREACHABLE("Unsupported style backend");
   }
 
   return result;
 }
@@ -1232,132 +1023,16 @@ EffectCompositor::PreTraverse(dom::Eleme
     }
 
     elementSet.Remove(key);
     found = true;
   }
   return found;
 }
 
-#ifdef MOZ_OLD_STYLE
-// ---------------------------------------------------------
-//
-// Nested class: AnimationStyleRuleProcessor
-//
-// ---------------------------------------------------------
-
-NS_IMPL_ISUPPORTS(EffectCompositor::AnimationStyleRuleProcessor,
-                  nsIStyleRuleProcessor)
-
-nsRestyleHint
-EffectCompositor::AnimationStyleRuleProcessor::HasStateDependentStyle(
-  StateRuleProcessorData* aData)
-{
-  return nsRestyleHint(0);
-}
-
-nsRestyleHint
-EffectCompositor::AnimationStyleRuleProcessor::HasStateDependentStyle(
-  PseudoElementStateRuleProcessorData* aData)
-{
-  return nsRestyleHint(0);
-}
-
-bool
-EffectCompositor::AnimationStyleRuleProcessor::HasDocumentStateDependentStyle(
-  StateRuleProcessorData* aData)
-{
-  return false;
-}
-
-nsRestyleHint
-EffectCompositor::AnimationStyleRuleProcessor::HasAttributeDependentStyle(
-                        AttributeRuleProcessorData* aData,
-                        RestyleHintData& aRestyleHintDataResult)
-{
-  return nsRestyleHint(0);
-}
-
-bool
-EffectCompositor::AnimationStyleRuleProcessor::MediumFeaturesChanged(
-  nsPresContext* aPresContext)
-{
-  return false;
-}
-
-void
-EffectCompositor::AnimationStyleRuleProcessor::RulesMatching(
-  ElementRuleProcessorData* aData)
-{
-  nsIStyleRule *rule =
-    mCompositor->GetAnimationRule(aData->mElement,
-                                  CSSPseudoElementType::NotPseudo,
-                                  mCascadeLevel,
-                                  nullptr);
-  if (rule) {
-    aData->mRuleWalker->Forward(rule);
-    aData->mRuleWalker->CurrentNode()->SetIsAnimationRule();
-  }
-}
-
-void
-EffectCompositor::AnimationStyleRuleProcessor::RulesMatching(
-  PseudoElementRuleProcessorData* aData)
-{
-  if (aData->mPseudoType != CSSPseudoElementType::before &&
-      aData->mPseudoType != CSSPseudoElementType::after) {
-    return;
-  }
-
-  nsIStyleRule *rule =
-    mCompositor->GetAnimationRule(aData->mElement,
-                                  aData->mPseudoType,
-                                  mCascadeLevel,
-                                  nullptr);
-  if (rule) {
-    aData->mRuleWalker->Forward(rule);
-    aData->mRuleWalker->CurrentNode()->SetIsAnimationRule();
-  }
-}
-
-void
-EffectCompositor::AnimationStyleRuleProcessor::RulesMatching(
-  AnonBoxRuleProcessorData* aData)
-{
-}
-
-#ifdef MOZ_XUL
-void
-EffectCompositor::AnimationStyleRuleProcessor::RulesMatching(
-  XULTreeRuleProcessorData* aData)
-{
-}
-#endif
-
-size_t
-EffectCompositor::AnimationStyleRuleProcessor::SizeOfExcludingThis(
-  MallocSizeOf aMallocSizeOf) const
-{
-  return 0;
-}
-
-size_t
-EffectCompositor::AnimationStyleRuleProcessor::SizeOfIncludingThis(
-  MallocSizeOf aMallocSizeOf) const
-{
-  return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
-}
-
-template
-void
-EffectCompositor::UpdateEffectProperties(
-  GeckoStyleContext* aStyleContext,
-  Element* aElement,
-  CSSPseudoElementType aPseudoType);
-#endif
 
 template
 void
 EffectCompositor::UpdateEffectProperties(
   const ServoStyleContext* aStyleContext,
   Element* aElement,
   CSSPseudoElementType aPseudoType);
 
--- a/dom/animation/EffectCompositor.h
+++ b/dom/animation/EffectCompositor.h
@@ -11,19 +11,16 @@
 #include "mozilla/Maybe.h"
 #include "mozilla/OwningNonNull.h"
 #include "mozilla/PseudoElementHashEntry.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/ServoTypes.h"
 #include "nsCSSPropertyID.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDataHashtable.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsIStyleRuleProcessor.h"
-#endif
 #include "nsTArray.h"
 
 class nsCSSPropertyIDSet;
 class nsAtom;
 class nsIFrame;
 class nsIStyleRule;
 class nsPresContext;
 class nsStyleContext;
@@ -45,23 +42,16 @@ class Element;
 }
 
 class EffectCompositor
 {
 public:
   explicit EffectCompositor(nsPresContext* aPresContext)
     : mPresContext(aPresContext)
   {
-#ifdef MOZ_OLD_STYLE
-    for (size_t i = 0; i < kCascadeLevelCount; i++) {
-      CascadeLevel cascadeLevel = CascadeLevel(i);
-      mRuleProcessors[cascadeLevel] =
-        new AnimationStyleRuleProcessor(this, cascadeLevel);
-    }
-#endif
   }
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(EffectCompositor)
   NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(EffectCompositor)
 
   void Disconnect() {
     mPresContext = nullptr;
   }
@@ -129,73 +119,30 @@ public:
   // have changed so that any context-sensitive values stored within
   // animation effects (e.g. em-based endpoints used in keyframe effects)
   // can be re-resolved to computed values.
   template<typename StyleType>
   void UpdateEffectProperties(StyleType* aStyleType,
                               dom::Element* aElement,
                               CSSPseudoElementType aPseudoType);
 
-#ifdef MOZ_OLD_STYLE
-  // Updates the animation rule stored on the EffectSet for the
-  // specified (pseudo-)element for cascade level |aLevel|.
-  // If the animation rule is not marked as needing an update,
-  // no work is done.
-  // |aStyleContext| is used for UpdateCascadingResults.
-  // |aStyleContext| can be nullptr if style context, which is associated with
-  // the primary frame of the specified (pseudo-)element, is the current style
-  // context.
-  // If we are resolving a new style context, we shoud pass the newly created
-  // style context, otherwise we may use an old style context, it will result
-  // unexpected cascading results.
-  void MaybeUpdateAnimationRule(dom::Element* aElement,
-                                CSSPseudoElementType aPseudoType,
-                                CascadeLevel aCascadeLevel,
-                                nsStyleContext *aStyleContext);
-
-  // We need to pass the newly resolved style context as |aStyleContext| when
-  // we call this function during resolving style context because this function
-  // calls UpdateCascadingResults with a style context if necessary, at the
-  // time, we end up using the previous style context if we don't pass the new
-  // style context.
-  // When we are not resolving style context, |aStyleContext| can be nullptr, we
-  // will use a style context associated with the primary frame of the specified
-  // (pseudo-)element.
-  nsIStyleRule* GetAnimationRule(dom::Element* aElement,
-                                 CSSPseudoElementType aPseudoType,
-                                 CascadeLevel aCascadeLevel,
-                                 nsStyleContext* aStyleContext);
-#endif
 
   // Get animation rule for stylo. This is an equivalent of GetAnimationRule
   // and will be called from servo side.
   // The animation rule is stored in |RawServoAnimationValueMapBorrowed|.
   // We need to be careful while doing any modification because it may cause
   // some thread-safe issues.
   bool GetServoAnimationRule(
     const dom::Element* aElement,
     CSSPseudoElementType aPseudoType,
     CascadeLevel aCascadeLevel,
     RawServoAnimationValueMapBorrowedMut aAnimationValues);
 
   bool HasPendingStyleUpdates() const;
 
-#ifdef MOZ_OLD_STYLE
-  bool HasThrottledStyleUpdates() const;
-
-  // Tell the restyle tracker about all the animated styles that have
-  // pending updates so that it can update the animation rule for these
-  // elements.
-  void AddStyleUpdatesTo(RestyleTracker& aTracker);
-
-  nsIStyleRuleProcessor* RuleProcessor(CascadeLevel aCascadeLevel) const
-  {
-    return mRuleProcessors[aCascadeLevel];
-  }
-#endif
 
   static bool HasAnimationsForCompositor(const nsIFrame* aFrame,
                                          nsCSSPropertyID aProperty);
 
   static nsTArray<RefPtr<dom::Animation>>
   GetAnimationsForCompositor(const nsIFrame* aFrame,
                              nsCSSPropertyID aProperty);
 
@@ -285,23 +232,16 @@ public:
   // pseudo type (other thant CSSPseudoElementType::NotPseudo) returns nullptr.
   // Otherwise, returns |aElement|.
   static dom::Element* GetElementToRestyle(dom::Element* aElement,
                                            CSSPseudoElementType aPseudoType);
 
 private:
   ~EffectCompositor() = default;
 
-#ifdef MOZ_OLD_STYLE
-  // Rebuilds the animation rule corresponding to |aCascadeLevel| on the
-  // EffectSet associated with the specified (pseudo-)element.
-  static void ComposeAnimationRule(dom::Element* aElement,
-                                   CSSPseudoElementType aPseudoType,
-                                   CascadeLevel aCascadeLevel);
-#endif
 
   // Get the properties in |aEffectSet| that we are able to animate on the
   // compositor but which are also specified at a higher level in the cascade
   // than the animations level.
   //
   // When |aBackendType| is StyleBackendType::Gecko, we determine which
   // properties are specified using the provided |aStyleContext| and
   // |aElement| and |aPseudoType| are ignored. If |aStyleContext| is nullptr,
@@ -327,59 +267,13 @@ private:
   // indicate that the style rule on the element is out of date but without
   // posting a restyle to update it.
   EnumeratedArray<CascadeLevel, CascadeLevel(kCascadeLevelCount),
                   nsDataHashtable<PseudoElementHashEntry, bool>>
                     mElementsToRestyle;
 
   bool mIsInPreTraverse = false;
 
-#ifdef MOZ_OLD_STYLE
-  class AnimationStyleRuleProcessor final : public nsIStyleRuleProcessor
-  {
-  public:
-    AnimationStyleRuleProcessor(EffectCompositor* aCompositor,
-                                CascadeLevel aCascadeLevel)
-      : mCompositor(aCompositor)
-      , mCascadeLevel(aCascadeLevel)
-    {
-      MOZ_ASSERT(aCompositor);
-    }
-
-    NS_DECL_ISUPPORTS
-
-    // nsIStyleRuleProcessor (parts)
-    nsRestyleHint HasStateDependentStyle(
-                        StateRuleProcessorData* aData) override;
-    nsRestyleHint HasStateDependentStyle(
-                        PseudoElementStateRuleProcessorData* aData) override;
-    bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) override;
-    nsRestyleHint HasAttributeDependentStyle(
-                        AttributeRuleProcessorData* aData,
-                        RestyleHintData& aRestyleHintDataResult) override;
-    bool MediumFeaturesChanged(nsPresContext* aPresContext) override;
-    void RulesMatching(ElementRuleProcessorData* aData) override;
-    void RulesMatching(PseudoElementRuleProcessorData* aData) override;
-    void RulesMatching(AnonBoxRuleProcessorData* aData) override;
-#ifdef MOZ_XUL
-    void RulesMatching(XULTreeRuleProcessorData* aData) override;
-#endif
-    size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf)
-      const MOZ_MUST_OVERRIDE override;
-    size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf)
-      const MOZ_MUST_OVERRIDE override;
-
-  private:
-    ~AnimationStyleRuleProcessor() = default;
-
-    EffectCompositor* mCompositor;
-    CascadeLevel      mCascadeLevel;
-  };
-
-  EnumeratedArray<CascadeLevel, CascadeLevel(kCascadeLevelCount),
-                  OwningNonNull<AnimationStyleRuleProcessor>>
-                    mRuleProcessors;
-#endif
 };
 
 } // namespace mozilla
 
 #endif // mozilla_EffectCompositor_h
--- a/dom/animation/EffectSet.h
+++ b/dom/animation/EffectSet.h
@@ -2,19 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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_EffectSet_h
 #define mozilla_EffectSet_h
 
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/AnimValuesStyleRule.h"
-#endif
 #include "mozilla/DebugOnly.h"
 #include "mozilla/EffectCompositor.h"
 #include "mozilla/EnumeratedArray.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/dom/KeyframeEffectReadOnly.h"
 #include "nsHashKeys.h" // For nsPtrHashKey
 #include "nsTHashtable.h" // For nsTHashtable
 
@@ -167,23 +164,16 @@ public:
 #ifdef DEBUG
   bool IsBeingEnumerated() const { return mActiveIterators != 0; }
 #endif
 
   bool IsEmpty() const { return mEffects.IsEmpty(); }
 
   size_t Count() const { return mEffects.Count(); }
 
-#ifdef MOZ_OLD_STYLE
-  RefPtr<AnimValuesStyleRule>&
-  AnimationRule(EffectCompositor::CascadeLevel aCascadeLevel)
-  {
-    return mAnimationRule[aCascadeLevel];
-  }
-#endif
 
   const TimeStamp& LastTransformSyncTime() const
   {
     return mLastTransformSyncTime;
   }
   void UpdateLastTransformSyncTime(const TimeStamp& aRefreshTime)
   {
     mLastTransformSyncTime = aRefreshTime;
@@ -211,27 +201,16 @@ public:
     return mPropertiesForAnimationsLevel;
   }
 
 private:
   static nsAtom* GetEffectSetPropertyAtom(CSSPseudoElementType aPseudoType);
 
   OwningEffectSet mEffects;
 
-#ifdef MOZ_OLD_STYLE
-  // These style rules contain the style data for currently animating
-  // values.  They only match when styling with animation.  When we
-  // style without animation, we need to not use them so that we can
-  // detect any new changes; if necessary we restyle immediately
-  // afterwards with animation.
-  EnumeratedArray<EffectCompositor::CascadeLevel,
-                  EffectCompositor::CascadeLevel(
-                    EffectCompositor::kCascadeLevelCount),
-                  RefPtr<AnimValuesStyleRule>> mAnimationRule;
-#endif
 
   // Refresh driver timestamp from the moment when transform animations in this
   // effect set were last updated and sent to the compositor. This is used for
   // transform animations that run on the compositor but need to be updated on
   // the main thread periodically (e.g. so scrollbars can be updated).
   TimeStamp mLastTransformSyncTime;
 
   // Dirty flag to represent when the mPropertiesWithImportantRules and
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -7,26 +7,20 @@
 #include "mozilla/dom/KeyframeEffectReadOnly.h"
 
 #include "FrameLayerBuilder.h"
 #include "mozilla/dom/Animation.h"
 #include "mozilla/dom/KeyframeAnimationOptionsBinding.h"
   // For UnrestrictedDoubleOrKeyframeAnimationOptions;
 #include "mozilla/dom/CSSPseudoElement.h"
 #include "mozilla/dom/KeyframeEffectBinding.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/AnimValuesStyleRule.h"
-#endif
 #include "mozilla/AnimationUtils.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/EffectSet.h"
 #include "mozilla/FloatingPoint.h" // For IsFinite
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoStyleContext.h"
-#endif
 #include "mozilla/LayerAnimationInfo.h"
 #include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
 #include "mozilla/KeyframeUtils.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/TypeTraits.h"
 #include "Layers.h" // For Layer
 #include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetStyleContext
 #include "nsContentUtils.h"
@@ -194,60 +188,41 @@ KeyframeEffectReadOnly::SetKeyframes(JSC
     KeyframeUtils::GetKeyframesFromObject(aContext, mDocument, aKeyframes, aRv);
   if (aRv.Failed()) {
     return;
   }
 
   RefPtr<nsStyleContext> styleContext = GetTargetStyleContext();
   if (styleContext) {
     if (styleContext->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-      auto gecko = styleContext->AsGecko();
-      SetKeyframes(Move(keyframes), gecko);
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     } else {
       SetKeyframes(Move(keyframes), styleContext->AsServo());
     }
   } else {
     // SetKeyframes has the same behavior for null StyleType* for
     // both backends, just pick one and use it.
     SetKeyframes(Move(keyframes), (ServoStyleContext*) nullptr);
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-KeyframeEffectReadOnly::SetKeyframes(nsTArray<Keyframe>&& aKeyframes,
-                                     GeckoStyleContext* aStyleContext)
-{
-  DoSetKeyframes(Move(aKeyframes), Move(aStyleContext));
-}
-#endif
 
 void
 KeyframeEffectReadOnly::SetKeyframes(
   nsTArray<Keyframe>&& aKeyframes,
   const ServoStyleContext* aComputedValues)
 {
   DoSetKeyframes(Move(aKeyframes), aComputedValues);
 }
 
 template<typename StyleType>
 void
 KeyframeEffectReadOnly::DoSetKeyframes(nsTArray<Keyframe>&& aKeyframes,
                                        StyleType* aStyle)
 {
-#ifdef MOZ_OLD_STYLE
-  static_assert(IsSame<StyleType, GeckoStyleContext>::value ||
-                IsSame<StyleType, const ServoStyleContext>::value,
-                "StyleType should be GeckoStyleContext* or "
-                "const ServoStyleContext*");
-#endif
 
   if (KeyframesEqualIgnoringComputedOffsets(aKeyframes, mKeyframes)) {
     return;
   }
 
   mKeyframes = Move(aKeyframes);
   KeyframeUtils::DistributeKeyframes(mKeyframes);
 
@@ -322,23 +297,17 @@ SpecifiedKeyframeArraysAreEqual(const ns
 #endif
 
 void
 KeyframeEffectReadOnly::UpdateProperties(nsStyleContext* aStyleContext)
 {
   MOZ_ASSERT(aStyleContext);
 
   if (aStyleContext->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    auto gecko = aStyleContext->AsGecko();
-    DoUpdateProperties(Move(gecko));
-    return;
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   UpdateProperties(aStyleContext->AsServo());
 }
 
 void
 KeyframeEffectReadOnly::UpdateProperties(
   const ServoStyleContext* aStyleContext)
@@ -390,150 +359,16 @@ 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
-  // (i.e. missing keyframe).
-  if (aValueToComposite.IsNull()) {
-    return aUnderlyingValue;
-  }
-
-  switch (aCompositeOperation) {
-    case dom::CompositeOperation::Replace:
-      return aValueToComposite;
-    case dom::CompositeOperation::Add: {
-      StyleAnimationValue result(aValueToComposite);
-      return StyleAnimationValue::Add(aProperty,
-                                      aUnderlyingValue,
-                                      Move(result));
-    }
-    case dom::CompositeOperation::Accumulate: {
-      StyleAnimationValue result(aValueToComposite);
-      return StyleAnimationValue::Accumulate(aProperty,
-                                             aUnderlyingValue,
-                                             Move(result));
-    }
-    default:
-      MOZ_ASSERT_UNREACHABLE("Unknown compisite operation type");
-      break;
-  }
-  return StyleAnimationValue();
-}
-
-StyleAnimationValue
-KeyframeEffectReadOnly::GetUnderlyingStyle(
-  nsCSSPropertyID aProperty,
-  const RefPtr<AnimValuesStyleRule>& aAnimationRule)
-{
-  StyleAnimationValue result;
-
-  if (aAnimationRule && aAnimationRule->HasValue(aProperty)) {
-    // If we have already composed style for the property, we use the style
-    // as the underlying style.
-    DebugOnly<bool> success = aAnimationRule->GetValue(aProperty, result);
-    MOZ_ASSERT(success, "AnimValuesStyleRule::GetValue should not fail");
-  } else {
-    // If we are composing with composite operation that is not 'replace'
-    // and we have not composed style for the property yet, we have to get
-    // the base style for the property.
-    result = BaseStyle(aProperty).mGecko;
-  }
-
-  return result;
-}
-
-StyleAnimationValue
-KeyframeEffectReadOnly::CompositeValue(
-  nsCSSPropertyID aProperty,
-  const RefPtr<AnimValuesStyleRule>& aAnimationRule,
-  const StyleAnimationValue& aValueToComposite,
-  CompositeOperation aCompositeOperation)
-{
-  MOZ_ASSERT(mTarget, "CompositeValue should be called with target element");
-  MOZ_ASSERT(!mDocument->IsStyledByServo());
-
-  StyleAnimationValue underlyingValue =
-    GetUnderlyingStyle(aProperty, aAnimationRule);
-
-  return CompositeValue(aProperty,
-                        aValueToComposite,
-                        underlyingValue,
-                        aCompositeOperation);
-}
-
-void
-KeyframeEffectReadOnly::EnsureBaseStyles(
-  GeckoStyleContext* aStyleContext,
-  const nsTArray<AnimationProperty>& aProperties)
-{
-  if (!mTarget) {
-    return;
-  }
-
-  mBaseStyleValues.Clear();
-
-  RefPtr<GeckoStyleContext> cachedBaseStyleContext;
-
-  for (const AnimationProperty& property : aProperties) {
-    for (const AnimationPropertySegment& segment : property.mSegments) {
-      if (segment.HasReplaceableValues()) {
-        continue;
-      }
-
-      EnsureBaseStyle(property.mProperty,
-                      aStyleContext,
-                      cachedBaseStyleContext);
-      break;
-    }
-  }
-}
-
-void
-KeyframeEffectReadOnly::EnsureBaseStyle(
-  nsCSSPropertyID aProperty,
-  GeckoStyleContext* aStyleContext,
-  RefPtr<GeckoStyleContext>& aCachedBaseStyleContext)
-{
-  if (mBaseStyleValues.Contains(aProperty)) {
-    return;
-  }
-
-  if (!aCachedBaseStyleContext) {
-    aCachedBaseStyleContext =
-      aStyleContext->PresContext()->StyleSet()->AsGecko()->
-        ResolveStyleByRemovingAnimation(mTarget->mElement,
-                                        aStyleContext,
-                                        eRestyle_AllHintsWithAnimations);
-  }
-
-  StyleAnimationValue result;
-  DebugOnly<bool> success =
-    StyleAnimationValue::ExtractComputedValue(aProperty,
-                                              aCachedBaseStyleContext,
-                                              result);
-
-  MOZ_ASSERT(success, "Should be able to extract computed animation value");
-  MOZ_ASSERT(!result.IsNull(), "Should have a valid StyleAnimationValue");
-
-  mBaseStyleValues.Put(aProperty, result);
-}
-#endif
 
 void
 KeyframeEffectReadOnly::EnsureBaseStyles(
   const ServoStyleContext* aComputedValues,
   const nsTArray<AnimationProperty>& aProperties)
 {
   if (!mTarget) {
     return;
@@ -605,97 +440,16 @@ KeyframeEffectReadOnly::EnsureBaseStyle(
 void
 KeyframeEffectReadOnly::WillComposeStyle()
 {
   ComputedTiming computedTiming = GetComputedTiming();
   mProgressOnLastCompose = computedTiming.mProgress;
   mCurrentIterationOnLastCompose = computedTiming.mCurrentIteration;
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-KeyframeEffectReadOnly::ComposeStyleRule(
-  RefPtr<AnimValuesStyleRule>& aStyleRule,
-  const AnimationProperty& aProperty,
-  const AnimationPropertySegment& aSegment,
-  const ComputedTiming& aComputedTiming)
-{
-  StyleAnimationValue fromValue =
-    CompositeValue(aProperty.mProperty, aStyleRule,
-                   aSegment.mFromValue.mGecko,
-                   aSegment.mFromComposite);
-  StyleAnimationValue toValue =
-    CompositeValue(aProperty.mProperty, aStyleRule,
-                   aSegment.mToValue.mGecko,
-                   aSegment.mToComposite);
-  if (fromValue.IsNull() || toValue.IsNull()) {
-    return;
-  }
-
-  if (!aStyleRule) {
-    // Allocate the style rule now that we know we have animation data.
-    aStyleRule = new AnimValuesStyleRule();
-  }
-
-  // Iteration composition for accumulate
-  if (mEffectOptions.mIterationComposite ==
-      IterationCompositeOperation::Accumulate &&
-      aComputedTiming.mCurrentIteration > 0) {
-    const AnimationPropertySegment& lastSegment =
-      aProperty.mSegments.LastElement();
-    // FIXME: Bug 1293492: Add a utility function to calculate both of
-    // below StyleAnimationValues.
-    StyleAnimationValue lastValue = lastSegment.mToValue.mGecko.IsNull()
-      ? GetUnderlyingStyle(aProperty.mProperty, aStyleRule)
-      : lastSegment.mToValue.mGecko;
-    fromValue =
-      StyleAnimationValue::Accumulate(aProperty.mProperty,
-                                      lastValue,
-                                      Move(fromValue),
-                                      aComputedTiming.mCurrentIteration);
-    toValue =
-      StyleAnimationValue::Accumulate(aProperty.mProperty,
-                                      lastValue,
-                                      Move(toValue),
-                                      aComputedTiming.mCurrentIteration);
-  }
-
-  // Special handling for zero-length segments
-  if (aSegment.mToKey == aSegment.mFromKey) {
-    if (aComputedTiming.mProgress.Value() < 0) {
-      aStyleRule->AddValue(aProperty.mProperty, Move(fromValue));
-    } else {
-      aStyleRule->AddValue(aProperty.mProperty, Move(toValue));
-    }
-    return;
-  }
-
-  double positionInSegment =
-    (aComputedTiming.mProgress.Value() - aSegment.mFromKey) /
-    (aSegment.mToKey - aSegment.mFromKey);
-  double valuePosition =
-    ComputedTimingFunction::GetPortion(aSegment.mTimingFunction,
-                                       positionInSegment,
-                                       aComputedTiming.mBeforeFlag);
-
-  MOZ_ASSERT(IsFinite(valuePosition), "Position value should be finite");
-
-  StyleAnimationValue val;
-  if (StyleAnimationValue::Interpolate(aProperty.mProperty,
-                                       fromValue,
-                                       toValue,
-                                       valuePosition, val)) {
-    aStyleRule->AddValue(aProperty.mProperty, Move(val));
-  } else if (valuePosition < 0.5) {
-    aStyleRule->AddValue(aProperty.mProperty, Move(fromValue));
-  } else {
-    aStyleRule->AddValue(aProperty.mProperty, Move(toValue));
-  }
-}
-#endif
 
 void
 KeyframeEffectReadOnly::ComposeStyleRule(
   RawServoAnimationValueMap& aAnimationValues,
   const AnimationProperty& aProperty,
   const AnimationPropertySegment& aSegment,
   const ComputedTiming& aComputedTiming)
 {
@@ -973,22 +727,16 @@ KeyframeEffectReadOnly::ConstructKeyfram
   effect->mProperties = aSource.mProperties;
   return effect.forget();
 }
 
 template<typename StyleType>
 nsTArray<AnimationProperty>
 KeyframeEffectReadOnly::BuildProperties(StyleType* aStyle)
 {
-#ifdef MOZ_OLD_STYLE
-  static_assert(IsSame<StyleType, GeckoStyleContext>::value ||
-                IsSame<StyleType, const ServoStyleContext>::value,
-                "StyleType should be GeckoStyleContext* or "
-                "const ServoStyleContext*");
-#endif
 
   MOZ_ASSERT(aStyle);
 
   nsTArray<AnimationProperty> result;
   // If mTarget is null, return an empty property array.
   if (!mTarget) {
     return result;
   }
@@ -1368,48 +1116,17 @@ KeyframeEffectReadOnly::GetKeyframes(JSC
 
           if (value) {
             Servo_AnimationValue_Serialize(value,
                                            propertyValue.mProperty,
                                            &stringValue);
           }
         }
       } else {
-#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");
-          }
-          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);
@@ -1780,46 +1497,16 @@ KeyframeEffectReadOnly::SetPerformanceWa
         nsAutoCString logMessage = NS_ConvertUTF16toUTF8(localizedString);
         AnimationUtils::LogAsyncAnimationFailure(logMessage, mTarget->mElement);
       }
       return;
     }
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-already_AddRefed<nsStyleContext>
-KeyframeEffectReadOnly::CreateStyleContextForAnimationValue(
-  nsCSSPropertyID aProperty,
-  const AnimationValue& aValue,
-  GeckoStyleContext* aBaseStyleContext)
-{
-  MOZ_ASSERT(aBaseStyleContext,
-             "CreateStyleContextForAnimationValue needs to be called "
-             "with a valid GeckoStyleContext");
-
-  RefPtr<AnimValuesStyleRule> styleRule = new AnimValuesStyleRule();
-  styleRule->AddValue(aProperty, aValue.mGecko);
-
-  nsCOMArray<nsIStyleRule> rules;
-  rules.AppendObject(styleRule);
-
-  nsStyleSet* styleSet =
-    aBaseStyleContext->PresContext()->StyleSet()->AsGecko();
-
-  RefPtr<GeckoStyleContext> styleContext =
-    styleSet->ResolveStyleByAddingRules(aBaseStyleContext, rules);
-
-  // We need to call StyleData to generate cached data for the style context.
-  // Otherwise CalcStyleDifference returns no meaningful result.
-  styleContext->StyleData(nsCSSProps::kSIDTable[aProperty]);
-
-  return styleContext.forget();
-}
-#endif
 
 already_AddRefed<nsStyleContext>
 KeyframeEffectReadOnly::CreateStyleContextForAnimationValue(
   nsCSSPropertyID aProperty,
   const AnimationValue& aValue,
   const ServoStyleContext* aBaseStyleContext)
 {
   MOZ_ASSERT(aBaseStyleContext,
@@ -2050,23 +1737,16 @@ KeyframeEffectReadOnly::UpdateEffectSet(
   if (HasAnimationOfProperty(eCSSProperty_transform)) {
     effectSet->SetMayHaveTransformAnimation();
     if (frame) {
       frame->SetMayHaveTransformAnimation();
     }
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-template
-void
-KeyframeEffectReadOnly::ComposeStyle<RefPtr<AnimValuesStyleRule>&>(
-  RefPtr<AnimValuesStyleRule>& aAnimationRule,
-  const nsCSSPropertyIDSet& aPropertiesToSkip);
-#endif
 
 template
 void
 KeyframeEffectReadOnly::ComposeStyle<RawServoAnimationValueMap&>(
   RawServoAnimationValueMap& aAnimationValues,
   const nsCSSPropertyIDSet& aPropertiesToSkip);
 
 } // namespace dom
--- a/dom/animation/KeyframeEffectReadOnly.h
+++ b/dom/animation/KeyframeEffectReadOnly.h
@@ -160,20 +160,16 @@ public:
 
   IterationCompositeOperation IterationComposite() const;
   CompositeOperation Composite() const;
   void NotifyAnimationTimingUpdated();
   void RequestRestyle(EffectCompositor::RestyleType aRestyleType);
   void SetAnimation(Animation* aAnimation) override;
   void SetKeyframes(JSContext* aContext, JS::Handle<JSObject*> aKeyframes,
                     ErrorResult& aRv);
-#ifdef MOZ_OLD_STYLE
-  void SetKeyframes(nsTArray<Keyframe>&& aKeyframes,
-                    GeckoStyleContext* aStyleContext);
-#endif
   void SetKeyframes(nsTArray<Keyframe>&& aKeyframes,
                     const ServoStyleContext* aComputedValues);
 
   // Returns true if the effect includes |aProperty| regardless of whether the
   // property is overridden by !important rule.
   bool HasAnimationOfProperty(nsCSSPropertyID aProperty) const;
 
   // GetEffectiveAnimationOfProperty returns AnimationProperty corresponding
@@ -209,26 +205,16 @@ 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.
@@ -278,21 +264,17 @@ 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,
@@ -350,49 +332,19 @@ protected:
   // of building a style context may trigger various forms of infinite
   // recursion.
   already_AddRefed<nsStyleContext> GetTargetStyleContext();
 
   // A wrapper for marking cascade update according to the current
   // target and its effectSet.
   void MarkCascadeNeedsUpdate();
 
-#ifdef MOZ_OLD_STYLE
-  // Composites |aValueToComposite| using |aCompositeOperation| onto the value
-  // for |aProperty| in |aAnimationRule|, or, if there is no suitable value in
-  // |aAnimationRule|, uses the base value for the property recorded on the
-  // target element's EffectSet.
-  StyleAnimationValue CompositeValue(
-    nsCSSPropertyID aProperty,
-    const RefPtr<AnimValuesStyleRule>& aAnimationRule,
-    const StyleAnimationValue& aValueToComposite,
-    CompositeOperation aCompositeOperation);
-
-  // Returns underlying style animation value for |aProperty|.
-  StyleAnimationValue GetUnderlyingStyle(
-    nsCSSPropertyID aProperty,
-    const RefPtr<AnimValuesStyleRule>& aAnimationRule);
-
-  // Ensure the base styles is available for any properties in |aProperties|.
-  void EnsureBaseStyles(GeckoStyleContext* aStyleContext,
-                        const nsTArray<AnimationProperty>& aProperties);
-#endif
   void EnsureBaseStyles(const ServoStyleContext* aComputedValues,
                         const nsTArray<AnimationProperty>& aProperties);
 
-#ifdef MOZ_OLD_STYLE
-  // If no base style is already stored for |aProperty|, resolves the base style
-  // for |aProperty| using |aStyleContext| and stores it in mBaseStyleValues.
-  // If |aCachedBaseStyleContext| is non-null, it will be used, otherwise the
-  // base style context will be resolved and stored in
-  // |aCachedBaseStyleContext|.
-  void EnsureBaseStyle(nsCSSPropertyID aProperty,
-                       GeckoStyleContext* aStyleContext,
-                       RefPtr<GeckoStyleContext>& aCachedBaseStyleContext);
-#endif
   // Stylo version of the above function that also first checks for an additive
   // value in |aProperty|'s list of segments.
   void EnsureBaseStyle(const AnimationProperty& aProperty,
                        nsPresContext* aPresContext,
                        const ServoStyleContext* aComputedValues,
                        RefPtr<mozilla::ServoStyleContext>& aBaseComputedValues);
 
   Maybe<OwningAnimationTarget> mTarget;
@@ -417,19 +369,16 @@ 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;
 
@@ -437,34 +386,22 @@ private:
   nsChangeHint mCumulativeChangeHint;
 
   template<typename StyleType>
   void DoSetKeyframes(nsTArray<Keyframe>&& aKeyframes, StyleType* aStyle);
 
   template<typename StyleType>
   void DoUpdateProperties(StyleType* aStyle);
 
-#ifdef MOZ_OLD_STYLE
-  void ComposeStyleRule(RefPtr<AnimValuesStyleRule>& aStyleRule,
-                        const AnimationProperty& aProperty,
-                        const AnimationPropertySegment& aSegment,
-                        const ComputedTiming& aComputedTiming);
-#endif
 
   void ComposeStyleRule(RawServoAnimationValueMap& aAnimationValues,
                         const AnimationProperty& aProperty,
                         const AnimationPropertySegment& aSegment,
                         const ComputedTiming& aComputedTiming);
 
-#ifdef MOZ_OLD_STYLE
-  already_AddRefed<nsStyleContext> CreateStyleContextForAnimationValue(
-    nsCSSPropertyID aProperty,
-    const AnimationValue& aValue,
-    GeckoStyleContext* aBaseStyleContext);
-#endif
 
   already_AddRefed<nsStyleContext> CreateStyleContextForAnimationValue(
     nsCSSPropertyID aProperty,
     const AnimationValue& aValue,
     const ServoStyleContext* aBaseStyleContext);
 
   nsIFrame* GetAnimationFrame() const;
 
--- a/dom/animation/KeyframeUtils.cpp
+++ b/dom/animation/KeyframeUtils.cpp
@@ -359,28 +359,18 @@ MakePropertyValuePair(nsCSSPropertyID aP
 
 static bool
 HasValidOffsets(const nsTArray<Keyframe>& aKeyframes);
 
 #ifdef DEBUG
 static void
 MarkAsComputeValuesFailureKey(PropertyValuePair& aPair);
 
-#ifdef MOZ_OLD_STYLE
-static bool
-IsComputeValuesFailureKey(const PropertyValuePair& aPair);
-#endif
 #endif
 
-#ifdef MOZ_OLD_STYLE
-static nsTArray<ComputedKeyframeValues>
-GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
-                          dom::Element* aElement,
-                          GeckoStyleContext* aStyleContext);
-#endif
 
 static nsTArray<ComputedKeyframeValues>
 GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
                           dom::Element* aElement,
                           const ServoStyleContext* aComputedValues);
 
 static void
 BuildSegmentsFromValueEntries(nsTArray<KeyframeValueEntry>& aEntries,
@@ -896,59 +886,17 @@ MakePropertyValuePair(nsCSSPropertyID aP
     if (servoDeclarationBlock) {
       result.emplace(aProperty, Move(servoDeclarationBlock));
     } else {
       ReportInvalidPropertyValueToConsole(aProperty, aStringValue, aDocument);
     }
     return result;
   }
 
-#ifdef MOZ_OLD_STYLE
-  nsCSSValue value;
-  if (!nsCSSProps::IsShorthand(aProperty)) {
-    aParser.ParseLonghandProperty(aProperty,
-                                  aStringValue,
-                                  aDocument->GetDocumentURI(),
-                                  aDocument->GetDocumentURI(),
-                                  aDocument->NodePrincipal(),
-                                  value);
-    if (value.GetUnit() == eCSSUnit_Null) {
-      // Invalid property value, so return Nothing.
-      ReportInvalidPropertyValueToConsole(aProperty, aStringValue, aDocument);
-      return result;
-    }
-  }
-
-  if (value.GetUnit() == eCSSUnit_Null) {
-    // If we have a shorthand, store the string value as a token stream.
-    nsCSSValueTokenStream* tokenStream = new nsCSSValueTokenStream;
-    tokenStream->mTokenStream = aStringValue;
-
-    // We are about to convert a null value to a token stream value but
-    // by leaving the mPropertyID as unknown, we will be able to
-    // distinguish between shorthand values and valid token stream values
-    // (e.g. values with variable references).
-    MOZ_ASSERT(tokenStream->mPropertyID == eCSSProperty_UNKNOWN,
-               "The property of a token stream should be initialized"
-               " to unknown");
-
-    // By leaving mShorthandPropertyID as unknown, we ensure that when
-    // we call nsCSSValue::AppendToString we get back the string stored
-    // in mTokenStream.
-    MOZ_ASSERT(tokenStream->mShorthandPropertyID == eCSSProperty_UNKNOWN,
-               "The shorthand property of a token stream should be initialized"
-               " to unknown");
-    value.SetTokenStreamValue(tokenStream);
-  }
-
-  result.emplace(aProperty, Move(value));
-  return result;
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 /**
  * Checks that the given keyframes are loosely ordered (each keyframe's
  * offset that is not null is greater than or equal to the previous
  * non-null offset) and that all values are within the range [0.0, 1.0].
  *
  * @return true if the keyframes' offsets are correctly ordered and
@@ -983,123 +931,18 @@ static void
 MarkAsComputeValuesFailureKey(PropertyValuePair& aPair)
 {
   MOZ_ASSERT(nsCSSProps::IsShorthand(aPair.mProperty),
              "Only shorthand property values can be marked as failure values");
 
   aPair.mSimulateComputeValuesFailure = true;
 }
 
-#ifdef MOZ_OLD_STYLE
-/**
- * Returns true if |aPair| is a property-value pair on which we have
- * previously called MarkAsComputeValuesFailureKey (and hence we should
- * simulate failure when calling StyleAnimationValue::ComputeValues using its
- * value).
- *
- * @param aPair The property-value pair to test.
- * @return True if |aPair| represents a failure value.
- */
-static bool
-IsComputeValuesFailureKey(const PropertyValuePair& aPair)
-{
-  return nsCSSProps::IsShorthand(aPair.mProperty) &&
-         aPair.mSimulateComputeValuesFailure;
-}
-#endif
 #endif
 
-#ifdef MOZ_OLD_STYLE
-/**
- * Calculate the StyleAnimationValues of properties of each keyframe.
- * This involves expanding shorthand properties into longhand properties,
- * removing the duplicated properties for each keyframe, and creating an
- * array of |property:computed value| pairs for each keyframe.
- *
- * These computed values are used when computing the final set of
- * per-property animation values (see GetAnimationPropertiesFromKeyframes).
- *
- * @param aKeyframes The input keyframes.
- * @param aElement The context element.
- * @param aStyleContext The style context to use when computing values.
- * @return The set of ComputedKeyframeValues. The length will be the same as
- *   aFrames.
- */
-static nsTArray<ComputedKeyframeValues>
-GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
-                          dom::Element* aElement,
-                          GeckoStyleContext* aStyleContext)
-{
-  MOZ_ASSERT(aStyleContext);
-  MOZ_ASSERT(aElement);
-
-  const size_t len = aKeyframes.Length();
-  nsTArray<ComputedKeyframeValues> result(len);
-
-  for (const Keyframe& frame : aKeyframes) {
-    nsCSSPropertyIDSet propertiesOnThisKeyframe;
-    ComputedKeyframeValues* computedValues = result.AppendElement();
-    for (const PropertyValuePair& pair :
-           PropertyPriorityIterator(frame.mPropertyValues)) {
-      MOZ_ASSERT(!pair.mServoDeclarationBlock,
-                 "Animation values were parsed using Servo backend but target"
-                 " element is not using Servo backend?");
-
-      // Expand each value into the set of longhands and produce
-      // a KeyframeValueEntry for each value.
-      nsTArray<PropertyStyleAnimationValuePair> values;
-
-      // For shorthands, we store the string as a token stream so we need to
-      // extract that first.
-      if (nsCSSProps::IsShorthand(pair.mProperty)) {
-        nsCSSValueTokenStream* tokenStream = pair.mValue.GetTokenStreamValue();
-        if (!StyleAnimationValue::ComputeValues(pair.mProperty,
-              CSSEnabledState::eForAllContent, aElement, aStyleContext,
-              tokenStream->mTokenStream, /* aUseSVGMode */ false, values)) {
-          continue;
-        }
-
-#ifdef DEBUG
-        if (IsComputeValuesFailureKey(pair)) {
-          continue;
-        }
-#endif
-      } else if (pair.mValue.GetUnit() == eCSSUnit_Null) {
-        // An uninitialized nsCSSValue represents the underlying value which
-        // we represent as an uninitialized AnimationValue so we just leave
-        // neutralPair->mValue as-is.
-        PropertyStyleAnimationValuePair* neutralPair = values.AppendElement();
-        neutralPair->mProperty = pair.mProperty;
-      } else {
-        if (!StyleAnimationValue::ComputeValues(pair.mProperty,
-              CSSEnabledState::eForAllContent, aElement, aStyleContext,
-              pair.mValue, /* aUseSVGMode */ false, values)) {
-          continue;
-        }
-        MOZ_ASSERT(values.Length() == 1,
-                  "Longhand properties should produce a single"
-                  " StyleAnimationValue");
-      }
-
-      for (auto& value : values) {
-        // If we already got a value for this property on the keyframe,
-        // skip this one.
-        if (propertiesOnThisKeyframe.HasProperty(value.mProperty)) {
-          continue;
-        }
-        propertiesOnThisKeyframe.AddProperty(value.mProperty);
-        computedValues->AppendElement(Move(value));
-      }
-    }
-  }
-
-  MOZ_ASSERT(result.Length() == aKeyframes.Length(), "Array length mismatch");
-  return result;
-}
-#endif
 
 /**
  * The variation of the above function. This is for Servo backend.
  */
 static nsTArray<ComputedKeyframeValues>
 GetComputedKeyframeValues(const nsTArray<Keyframe>& aKeyframes,
                           dom::Element* aElement,
                           const ServoStyleContext* aStyleContext)
@@ -1639,27 +1482,17 @@ RequiresAdditiveAnimation(const nsTArray
                             : i == 0 ? 0.0 : 0.5;
     double offsetToUse = frame.mOffset
                          ? frame.mOffset.value()
                          : computedOffset;
 
     for (const PropertyValuePair& pair : frame.mPropertyValues) {
       if (nsCSSProps::IsShorthand(pair.mProperty)) {
         if (styleBackend == StyleBackendType::Gecko) {
-#ifdef MOZ_OLD_STYLE
-          nsCSSValueTokenStream* tokenStream =
-            pair.mValue.GetTokenStreamValue();
-          nsCSSParser parser(aDocument->CSSLoader());
-          if (!parser.IsValueValidForProperty(pair.mProperty,
-                                              tokenStream->mTokenStream)) {
-            continue;
-          }
-#else
           MOZ_CRASH("old style system disabled");
-#endif
         }
 
         MOZ_ASSERT(styleBackend != StyleBackendType::Servo ||
                    pair.mServoDeclarationBlock);
         CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(
             prop, pair.mProperty, CSSEnabledState::eForAllContent) {
           addToPropertySets(*prop, offsetToUse);
         }
@@ -1689,25 +1522,16 @@ DistributeRange(const Range<Keyframe>& a
   const double startOffset = aRange[0].mComputedOffset;
   const double diffOffset = aRange[n].mComputedOffset - startOffset;
   for (auto iter = rangeToAdjust.begin(); iter != rangeToAdjust.end(); ++iter) {
     size_t index = iter - aRange.begin();
     iter->mComputedOffset = startOffset + double(index) / n * diffOffset;
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-template
-nsTArray<AnimationProperty>
-KeyframeUtils::GetAnimationPropertiesFromKeyframes(
-  const nsTArray<Keyframe>& aKeyframes,
-  dom::Element* aElement,
-  GeckoStyleContext* aStyle,
-  dom::CompositeOperation aEffectComposite);
-#endif
 
 template
 nsTArray<AnimationProperty>
 KeyframeUtils::GetAnimationPropertiesFromKeyframes(
   const nsTArray<Keyframe>& aKeyframes,
   dom::Element* aElement,
   const ServoStyleContext* aStyle,
   dom::CompositeOperation aEffectComposite);
--- a/dom/animation/TimingParams.cpp
+++ b/dom/animation/TimingParams.cpp
@@ -8,19 +8,16 @@
 
 #include "mozilla/AnimationUtils.h"
 #include "mozilla/dom/AnimatableBinding.h"
 #include "mozilla/dom/KeyframeAnimationOptionsBinding.h"
 #include "mozilla/dom/KeyframeEffectBinding.h"
 #include "mozilla/ServoCSSParser.h"
 #include "nsCSSParser.h" // For nsCSSParser
 #include "nsIDocument.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleNode.h"
-#endif
 
 namespace mozilla {
 
 template <class OptionsType>
 static const dom::AnimationEffectTimingProperties&
 GetTimingProperties(const OptionsType& aOptions);
 
 template <>
@@ -129,70 +126,17 @@ TimingParams::ParseEasing(const nsAStrin
 
     if (timingFunction.mType == nsTimingFunction::Type::Linear) {
       return Nothing();
     }
 
     return Some(ComputedTimingFunction(timingFunction));
   }
 
-#ifdef MOZ_OLD_STYLE
-  nsCSSValue value;
-  nsCSSParser parser;
-  parser.ParseLonghandProperty(eCSSProperty_animation_timing_function,
-                               aEasing,
-                               aDocument->GetDocumentURI(),
-                               aDocument->GetDocumentURI(),
-                               aDocument->NodePrincipal(),
-                               value);
-
-  switch (value.GetUnit()) {
-    case eCSSUnit_List: {
-      const nsCSSValueList* list = value.GetListValue();
-      if (list->mNext) {
-        // don't support a list of timing functions
-        break;
-      }
-      switch (list->mValue.GetUnit()) {
-        case eCSSUnit_Enumerated:
-          // Return Nothing() if "linear" is passed in.
-          if (list->mValue.GetIntValue() ==
-              NS_STYLE_TRANSITION_TIMING_FUNCTION_LINEAR) {
-            return Nothing();
-          }
-          MOZ_FALLTHROUGH;
-        case eCSSUnit_Cubic_Bezier:
-        case eCSSUnit_Function:
-        case eCSSUnit_Steps: {
-          nsTimingFunction timingFunction;
-          nsRuleNode::ComputeTimingFunction(list->mValue, timingFunction);
-          return Some(ComputedTimingFunction(timingFunction));
-        }
-        default:
-          MOZ_ASSERT_UNREACHABLE("unexpected animation-timing-function list "
-                                 "item unit");
-        break;
-      }
-      break;
-    }
-    case eCSSUnit_Inherit:
-    case eCSSUnit_Initial:
-    case eCSSUnit_Unset:
-    case eCSSUnit_TokenStream:
-    case eCSSUnit_Null:
-      break;
-    default:
-      MOZ_ASSERT_UNREACHABLE("unexpected animation-timing-function unit");
-      break;
-  }
-
-  aRv.ThrowTypeError<dom::MSG_INVALID_EASING_ERROR>(aEasing);
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 
   return Nothing();
 }
 
 bool
 TimingParams::operator==(const TimingParams& aOther) const
 {
   // We don't compare mActiveDuration and mEndTime because they are calculated
--- a/dom/base/DOMIntersectionObserver.cpp
+++ b/dom/base/DOMIntersectionObserver.cpp
@@ -116,38 +116,17 @@ DOMIntersectionObserver::Constructor(con
 bool
 DOMIntersectionObserver::SetRootMargin(const nsAString& aString)
 {
   if (mDocument && mDocument->IsStyledByServo()) {
     return ServoCSSParser::ParseIntersectionObserverRootMargin(aString,
                                                                &mRootMargin);
   }
 
-#ifdef MOZ_OLD_STYLE
-  // By not passing a CSS Loader object we make sure we don't parse in quirks
-  // mode so that pixel/percent and unit-less values will be differentiated.
-  nsCSSParser parser(nullptr);
-  nsCSSValue value;
-  if (!parser.ParseMarginString(aString, nullptr, 0, value, true)) {
-    return false;
-  }
-
-  mRootMargin = value.GetRectValue();
-
-  for (auto side : nsCSSRect::sides) {
-    nsCSSValue& value = mRootMargin.*side;
-    if (!(value.IsPixelLengthUnit() || value.IsPercentLengthUnit())) {
-      return false;
-    }
-  }
-
-  return true;
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 void
 DOMIntersectionObserver::GetRootMargin(mozilla::dom::DOMString& aRetVal)
 {
   mRootMargin.AppendToString(eCSSProperty_DOM, aRetVal);
 }
 
--- a/dom/base/DOMMatrix.cpp
+++ b/dom/base/DOMMatrix.cpp
@@ -680,50 +680,17 @@ DOMMatrix::SetMatrixValue(const nsAStrin
   if (mIsServo) {
     if (!ServoCSSParser::ParseTransformIntoMatrix(aTransformList,
                                                   contains3dTransform,
                                                   transform.components)) {
       aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
       return nullptr;
     }
   } else {
-#ifdef MOZ_OLD_STYLE
-    nsCSSValue value;
-    nsCSSParser parser;
-    bool parseSuccess = parser.ParseTransformProperty(aTransformList,
-                                                      true,
-                                                      value);
-    if (!parseSuccess) {
-      aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
-      return nullptr;
-    }
-
-    // A value of "none" results in a 2D identity matrix.
-    if (value.GetUnit() == eCSSUnit_None) {
-      mMatrix3D = nullptr;
-      mMatrix2D = new gfx::Matrix();
-      return this;
-    }
-
-    // A value other than a transform-list is a syntax error.
-    if (value.GetUnit() != eCSSUnit_SharedList) {
-      aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
-      return nullptr;
-    }
-
-    RuleNodeCacheConditions dummy;
-    nsStyleTransformMatrix::TransformReferenceBox dummyBox;
-    transform = nsStyleTransformMatrix::ReadTransforms(
-                    value.GetSharedListValue()->mHead,
-                    nullptr, nullptr, dummy, dummyBox,
-                    nsPresContext::AppUnitsPerCSSPixel(),
-                    &contains3dTransform);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   if (!contains3dTransform) {
     mMatrix3D = nullptr;
     mMatrix2D = new gfx::Matrix();
 
     SetA(transform._11);
     SetB(transform._12);
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -107,21 +107,16 @@
 #include "nsNodeInfoManager.h"
 #include "nsICategoryManager.h"
 #include "nsGenericHTMLElement.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsIControllers.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIScrollableFrame.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
-#include "nsCSSRuleProcessor.h"
-#include "nsRuleProcessorData.h"
-#endif
 #include "nsTextNode.h"
 
 #include "nsCycleCollectionParticipant.h"
 #include "nsCCUncollectableMarker.h"
 
 #include "mozAutoDocUpdate.h"
 
 #include "nsCSSParser.h"
@@ -3493,40 +3488,17 @@ Element::Closest(const nsAString& aSelec
     aResult,
     [&](const RawServoSelectorList* aList) -> Element* {
       if (!aList) {
         return nullptr;
       }
       return const_cast<Element*>(Servo_SelectorList_Closest(this, aList));
     },
     [&](nsCSSSelectorList* aList) -> Element* {
-#ifdef MOZ_OLD_STYLE
-      if (!aList) {
-        // Either we failed (and aError already has the exception), or this
-        // is a pseudo-element-only selector that matches nothing.
-        return nullptr;
-      }
-      TreeMatchContext matchingContext(false,
-                                       nsRuleWalker::eRelevantLinkUnvisited,
-                                       OwnerDoc(),
-                                       TreeMatchContext::eNeverMatchVisited);
-      matchingContext.SetHasSpecifiedScope();
-      matchingContext.AddScopeElement(this);
-      for (nsINode* node = this; node; node = node->GetParentNode()) {
-        if (node->IsElement() &&
-            nsCSSRuleProcessor::SelectorListMatches(node->AsElement(),
-                                                    matchingContext,
-                                                    aList)) {
-          return node->AsElement();
-        }
-      }
-      return nullptr;
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     }
   );
 }
 
 bool
 Element::Matches(const nsAString& aSelector, ErrorResult& aError)
 {
   return WithSelectorList<bool>(
@@ -3534,33 +3506,17 @@ Element::Matches(const nsAString& aSelec
     aError,
     [&](const RawServoSelectorList* aList) {
       if (!aList) {
         return false;
       }
       return Servo_SelectorList_Matches(this, aList);
     },
     [&](nsCSSSelectorList* aList) {
-#ifdef MOZ_OLD_STYLE
-      if (!aList) {
-        // Either we failed (and aError already has the exception), or this
-        // is a pseudo-element-only selector that matches nothing.
-        return false;
-      }
-      TreeMatchContext matchingContext(false,
-                                       nsRuleWalker::eRelevantLinkUnvisited,
-                                       OwnerDoc(),
-                                       TreeMatchContext::eNeverMatchVisited);
-      matchingContext.SetHasSpecifiedScope();
-      matchingContext.AddScopeElement(this);
-      return nsCSSRuleProcessor::SelectorListMatches(this, matchingContext,
-                                                     aList);
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     }
   );
 }
 
 static const nsAttrValue::EnumTable kCORSAttributeTable[] = {
   // Order matters here
   // See ParseCORSValue
   { "anonymous",       CORS_ANONYMOUS       },
@@ -4351,33 +4307,29 @@ Element::UpdateIntersectionObservation(D
   }
   return updated;
 }
 
 void
 Element::ClearServoData(nsIDocument* aDoc) {
   MOZ_ASSERT(IsStyledByServo());
   MOZ_ASSERT(aDoc);
-#ifdef MOZ_STYLO
   if (HasServoData()) {
     Servo_Element_ClearData(this);
   } else {
     UnsetFlags(kAllServoDescendantBits | NODE_NEEDS_FRAME);
   }
   // Since this element is losing its servo data, nothing under it may have
   // servo data either, so we can forget restyles rooted at this element. This
   // is necessary for correctness, since we invoke ClearServoData in various
   // places where an element's flattened tree parent changes, and such a change
   // may also make an element invalid to be used as a restyle root.
   if (aDoc->GetServoRestyleRoot() == this) {
     aDoc->ClearServoRestyleRoot();
   }
-#else
-  MOZ_CRASH("Accessing servo node data in non-stylo build");
-#endif
 }
 
 void
 Element::SetCustomElementData(CustomElementData* aData)
 {
   nsExtendedDOMSlots *slots = ExtendedDOMSlots();
   MOZ_ASSERT(!slots->mCustomElementData, "Custom element data may not be changed once set.");
   #if DEBUG
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -449,22 +449,16 @@ public:
    * Get a hint that tells the style system what to do when
    * an attribute on this node changes, if something needs to happen
    * in response to the change *other* than the result of what is
    * mapped into style data via any type of style rule.
    */
   virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute,
                                               int32_t aModType) const;
 
-#ifdef MOZ_OLD_STYLE
-  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker)
-  {
-    return NS_OK;
-  }
-#endif
 
   inline Directionality GetDirectionality() const {
     if (HasFlag(NODE_HAS_DIRECTION_RTL)) {
       return eDir_RTL;
     }
 
     if (HasFlag(NODE_HAS_DIRECTION_LTR)) {
       return eDir_LTR;
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -92,20 +92,16 @@
 #include "nsICategoryManager.h"
 #include "nsGenericHTMLElement.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsIControllers.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIScrollableFrame.h"
 #include "ChildIterator.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
-#include "nsRuleProcessorData.h"
-#endif
 #include "nsTextNode.h"
 #include "mozilla/dom/NodeListBinding.h"
 
 #include "nsCCUncollectableMarker.h"
 
 #include "mozAutoDocUpdate.h"
 
 #include "mozilla/Sprintf.h"
--- a/dom/base/ResponsiveImageSelector.cpp
+++ b/dom/base/ResponsiveImageSelector.cpp
@@ -8,21 +8,16 @@
 #include "mozilla/ServoStyleSet.h"
 #include "nsIURI.h"
 #include "nsIDocument.h"
 #include "nsContentUtils.h"
 #include "nsPresContext.h"
 
 #include "nsCSSParser.h"
 #include "nsCSSProps.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsMediaList.h"
-#include "nsRuleNode.h"
-#include "nsRuleData.h"
-#endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION(ResponsiveImageSelector, mOwnerNode)
@@ -246,27 +241,17 @@ ResponsiveImageSelector::SetSizesFromDes
   ClearSelectedCandidate();
 
   if (Document()->IsStyledByServo()) {
     NS_ConvertUTF16toUTF8 sizes(aSizes);
     mServoSourceSizeList.reset(Servo_SourceSizeList_Parse(&sizes));
     return !!mServoSourceSizeList;
   }
 
-#ifdef MOZ_OLD_STYLE
-  nsCSSParser cssParser;
-
-  mSizeQueries.Clear();
-  mSizeValues.Clear();
-
-  return cssParser.ParseSourceSizeList(aSizes, nullptr, 0,
-                                       mSizeQueries, mSizeValues);
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 void
 ResponsiveImageSelector::AppendCandidateIfUnique(const ResponsiveImageCandidate & aCandidate)
 {
   int numCandidates = mCandidates.Length();
 
   // With the exception of Default, which should not be added until we are done
@@ -459,40 +444,17 @@ ResponsiveImageSelector::ComputeFinalWid
   if (!pctx) {
     return false;
   }
   nscoord effectiveWidth;
   if (doc->IsStyledByServo()) {
     effectiveWidth = presShell->StyleSet()->AsServo()->EvaluateSourceSizeList(
       mServoSourceSizeList.get());
   } else {
-#ifdef MOZ_OLD_STYLE
-    unsigned int numSizes = mSizeQueries.Length();
-    MOZ_ASSERT(numSizes == mSizeValues.Length(),
-               "mSizeValues length differs from mSizeQueries");
-
-    unsigned int i;
-    for (i = 0; i < numSizes; i++) {
-      if (mSizeQueries[i]->Matches(pctx, nullptr)) {
-        break;
-      }
-    }
-
-    if (i == numSizes) {
-      // No match defaults to 100% viewport
-      nsCSSValue defaultWidth(100.0f, eCSSUnit_ViewportWidth);
-      effectiveWidth = nsRuleNode::CalcLengthWithInitialFont(pctx,
-                                                             defaultWidth);
-    } else {
-      effectiveWidth = nsRuleNode::CalcLengthWithInitialFont(pctx,
-                                                             mSizeValues[i]);
-    }
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   *aWidth = nsPresContext::AppUnitsToDoubleCSSPixels(std::max(effectiveWidth, 0));
   return true;
 }
 
 ResponsiveImageCandidate::ResponsiveImageCandidate()
 {
--- a/dom/base/ResponsiveImageSelector.h
+++ b/dom/base/ResponsiveImageSelector.h
@@ -120,21 +120,16 @@ private:
   int mSelectedCandidateIndex;
   // The cached resolved URL for mSelectedCandidateIndex, such that we only
   // resolve the absolute URL at selection time
   nsCOMPtr<nsIURI> mSelectedCandidateURL;
 
   // Servo bits.
   UniquePtr<RawServoSourceSizeList> mServoSourceSizeList;
 
-#ifdef MOZ_OLD_STYLE
-  // Gecko bits.
-  nsTArray< nsAutoPtr<nsMediaQuery> > mSizeQueries;
-  nsTArray<nsCSSValue> mSizeValues;
-#endif
 };
 
 class ResponsiveImageCandidate {
 public:
   ResponsiveImageCandidate();
   ResponsiveImageCandidate(const nsAString& aURLString, double aDensity,
                            nsIPrincipal* aTriggeringPrincipal = nullptr);
 
--- a/dom/base/StyleSheetList.cpp
+++ b/dom/base/StyleSheetList.cpp
@@ -1,19 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "mozilla/dom/StyleSheetList.h"
 
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/CSSStyleSheet.h"
-#endif
 #include "mozilla/dom/StyleSheetListBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(StyleSheetList)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleSheetList)
--- a/dom/base/nsAttrAndChildArray.cpp
+++ b/dom/base/nsAttrAndChildArray.cpp
@@ -13,19 +13,16 @@
 
 #include "mozilla/CheckedInt.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/MemoryReporting.h"
 
 #include "nsMappedAttributeElement.h"
 #include "nsString.h"
 #include "nsHTMLStyleSheet.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleWalker.h"
-#endif
 #include "nsMappedAttributes.h"
 #include "nsUnicharUtils.h"
 #include "nsContentUtils.h" // nsAutoScriptBlocker
 
 using mozilla::CheckedUint32;
 
 /*
 CACHE_POINTER_SHIFT indicates how many steps to downshift the |this| pointer.
@@ -626,25 +623,16 @@ nsAttrAndChildArray::DoSetMappedAttrStyl
   RefPtr<nsMappedAttributes> mapped =
     GetModifiableMapped(nullptr, nullptr, false);
 
   mapped->SetStyleSheet(aSheet);
 
   return MakeMappedUnique(mapped);
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-nsAttrAndChildArray::WalkMappedAttributeStyleRules(nsRuleWalker* aRuleWalker)
-{
-  if (mImpl && mImpl->mMappedAttrs) {
-    aRuleWalker->Forward(mImpl->mMappedAttrs);
-  }
-}
-#endif
 
 void
 nsAttrAndChildArray::Compact()
 {
   if (!mImpl) {
     return;
   }
 
--- a/dom/base/nsAttrAndChildArray.h
+++ b/dom/base/nsAttrAndChildArray.h
@@ -120,19 +120,16 @@ public:
                                 nsHTMLStyleSheet* aSheet,
                                 bool* aHadValue);
   nsresult SetMappedAttrStyleSheet(nsHTMLStyleSheet* aSheet) {
     if (!mImpl || !mImpl->mMappedAttrs) {
       return NS_OK;
     }
     return DoSetMappedAttrStyleSheet(aSheet);
   }
-#ifdef MOZ_OLD_STYLE
-  void WalkMappedAttributeStyleRules(nsRuleWalker* aRuleWalker);
-#endif
 
   void Compact();
 
   bool CanFitMoreAttrs() const
   {
     return AttrSlotCount() < ATTRCHILD_ARRAY_MAX_ATTR_COUNT ||
            !AttrSlotIsTaken(ATTRCHILD_ARRAY_MAX_ATTR_COUNT - 1);
   }
--- a/dom/base/nsAttrValue.cpp
+++ b/dom/base/nsAttrValue.cpp
@@ -1742,24 +1742,17 @@ nsAttrValue::ParseStyleAttribute(const n
   RefPtr<DeclarationBlock> decl;
   if (ownerDoc->GetStyleBackendType() == StyleBackendType::Servo) {
     RefPtr<URLExtraData> data = new URLExtraData(baseURI, docURI,
                                                  principal);
     decl = ServoDeclarationBlock::FromCssText(aString, data,
                                               ownerDoc->GetCompatibilityMode(),
                                               ownerDoc->CSSLoader());
   } else {
-#ifdef MOZ_OLD_STYLE
-    css::Loader* cssLoader = ownerDoc->CSSLoader();
-    nsCSSParser cssParser(cssLoader);
-    decl = cssParser.ParseStyleAttribute(aString, docURI, baseURI,
-                                         principal);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
   if (!decl) {
     return false;
   }
   decl->SetHTMLCSSStyleSheet(sheet);
   SetTo(decl.forget(), &aString);
 
   if (cachingAllowed) {
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -2837,53 +2837,17 @@ nsDOMWindowUtils::GetUnanimatedComputedS
                                                  propertyID).Consume();
     if (!value) {
       return NS_ERROR_FAILURE;
     }
     Servo_AnimationValue_Serialize(value, propertyID, &aResult);
     return NS_OK;
   }
 
-#ifdef MOZ_OLD_STYLE
-  StyleAnimationValue computedValue;
-  if (!StyleAnimationValue::ExtractComputedValue(propertyID,
-                                                 styleContext->AsGecko(),
-                                                 computedValue)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  // Note: ExtractComputedValue can return 'unset', 'initial', or 'inherit' in
-  // its "computedValue" outparam, even though these technically aren't valid
-  // computed values. (It has this behavior for discretely-animatable
-  // properties, e.g. 'align-content', when these keywords are explicitly
-  // specified or when there is no specified value.)  But we need to return a
-  // valid computed value -- these keywords won't do.  So we fall back to
-  // nsComputedDOMStyle in this case.
-  if (computedValue.GetUnit() == StyleAnimationValue::eUnit_DiscreteCSSValue &&
-      (computedValue.GetCSSValueValue()->GetUnit() == eCSSUnit_Unset ||
-       computedValue.GetCSSValueValue()->GetUnit() == eCSSUnit_Initial ||
-       computedValue.GetCSSValueValue()->GetUnit() == eCSSUnit_Inherit)) {
-    RefPtr<nsComputedDOMStyle> computedStyle =
-      NS_NewComputedDOMStyle(
-       element, aPseudoElement, shell,
-       nsComputedDOMStyle::StyleType::eAll,
-       nsComputedDOMStyle::AnimationFlag::eWithoutAnimation);
-    computedStyle->GetPropertyValue(propertyID, aResult);
-    return NS_OK;
-  }
-
-  DebugOnly<bool> uncomputeResult =
-    StyleAnimationValue::UncomputeValue(propertyID,
-                                        Move(computedValue), aResult);
-  MOZ_ASSERT(uncomputeResult,
-             "Unable to get specified value from computed value");
-  return NS_OK;
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 nsresult
 nsDOMWindowUtils::RenderDocument(const nsRect& aRect,
                                  uint32_t aFlags,
                                  nscolor aBackgroundColor,
                                  gfxContext* aThebesContext)
 {
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -225,19 +225,16 @@
 #include "mozilla/ExtensionPolicyService.h"
 #include "nsFrame.h"
 #include "nsDOMCaretPosition.h"
 #include "nsViewportInfo.h"
 #include "mozilla/StaticPtr.h"
 #include "nsITextControlElement.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsIEditor.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/StyleRule.h"
-#endif
 #include "nsIHttpChannelInternal.h"
 #include "nsISecurityConsoleMessage.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "mozilla/dom/XPathEvaluator.h"
 #include "mozilla/dom/XPathNSResolverBinding.h"
 #include "mozilla/dom/XPathResult.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIDocumentActivity.h"
@@ -1319,37 +1316,21 @@ nsIDocument::SelectorCache::SelectorList
 {
   if (mIsServo) {
     if (mServo) {
       Servo_SelectorList_Drop(mServo);
       mServo = nullptr;
     }
   } else {
     if (mGecko) {
-#ifdef MOZ_OLD_STYLE
-      delete mGecko;
-      mGecko = nullptr;
-#else
       MOZ_CRASH("old style system disabled");
-#endif
-    }
-  }
-}
-
-#ifdef MOZ_OLD_STYLE
-// CacheList takes ownership of aSelectorList.
-void nsIDocument::SelectorCache::CacheList(const nsAString& aSelector,
-                                           mozilla::UniquePtr<nsCSSSelectorList>&& aSelectorList)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  SelectorCacheKey* key = new SelectorCacheKey(aSelector);
-  mTable.Put(key->mKey, SelectorList(Move(aSelectorList)));
-  AddObject(key);
-}
-#endif
+    }
+  }
+}
+
 
 void nsIDocument::SelectorCache::CacheList(
   const nsAString& aSelector,
   UniquePtr<RawServoSelectorList>&& aSelectorList)
 {
   MOZ_ASSERT(NS_IsMainThread());
   SelectorCacheKey* key = new SelectorCacheKey(aSelector);
   mTable.Put(key->mKey, SelectorList(Move(aSelectorList)));
@@ -1950,19 +1931,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
   if (tmp->mBoxObjectTable) {
     for (auto iter = tmp->mBoxObjectTable->Iter(); !iter.Done(); iter.Next()) {
       NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mBoxObjectTable entry");
       cb.NoteXPCOMChild(iter.UserData());
     }
   }
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChannel)
-#ifdef MOZ_OLD_STYLE
-  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleAttrStyleSheet)
-#endif
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLayoutHistoryState)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOnloadBlocker)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFirstBaseNodeWithHref)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDOMImplementation)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImageMaps)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOrientationPendingPromise)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOriginalDocument)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCachedEncoder)
@@ -3706,32 +3684,27 @@ nsIDocument::SetBaseURI(nsIURI* aURI)
     mDocumentBaseURI = nullptr;
   }
   RefreshLinkHrefs();
 }
 
 URLExtraData*
 nsIDocument::DefaultStyleAttrURLData()
 {
-#ifdef MOZ_STYLO
   MOZ_ASSERT(NS_IsMainThread());
   nsIURI* baseURI = GetDocBaseURI();
   nsIURI* docURI = GetDocumentURI();
   nsIPrincipal* principal = NodePrincipal();
   if (!mCachedURLData ||
       mCachedURLData->BaseURI() != baseURI ||
       mCachedURLData->GetReferrer() != docURI ||
       mCachedURLData->GetPrincipal() != principal) {
     mCachedURLData = new URLExtraData(baseURI, docURI, principal);
   }
   return mCachedURLData;
-#else
-  MOZ_CRASH("Should not be called for non-stylo build");
-  return nullptr;
-#endif
 }
 
 void
 nsIDocument::SetDocumentCharacterSet(NotNull<const Encoding*> aEncoding)
 {
   if (mCharacterSet != aEncoding) {
     mCharacterSet = aEncoding;
 
@@ -12639,22 +12612,20 @@ void
 nsIDocument::UpdateStyleBackendType()
 {
   MOZ_ASSERT(mStyleBackendType == StyleBackendType::None,
              "no need to call UpdateStyleBackendType now");
 
   // Assume Gecko by default.
   mStyleBackendType = StyleBackendType::Gecko;
 
-#ifdef MOZ_STYLO
   if (nsLayoutUtils::StyloEnabled() &&
       nsLayoutUtils::ShouldUseStylo(NodePrincipal())) {
     mStyleBackendType = StyleBackendType::Servo;
   }
-#endif
 }
 
 void
 nsIDocument::SetUserHasInteracted(bool aUserHasInteracted)
 {
   MOZ_LOG(gUserInteractionPRLog, LogLevel::Debug,
           ("Document %p has been interacted by user.", this));
   mUserHasInteracted = aUserHasInteracted;
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -1517,39 +1517,28 @@ public:
         SelectorList& operator=(SelectorList&& aOther)
         {
           Reset();
           mIsServo = aOther.mIsServo;
           if (mIsServo) {
             mServo = aOther.mServo;
             aOther.mServo = nullptr;
           } else {
-#ifdef MOZ_OLD_STYLE
-            mGecko = aOther.mGecko;
-            aOther.mGecko = nullptr;
-#else
             MOZ_CRASH("old style system disabled");
-#endif
           }
           return *this;
         }
 
         SelectorList(const SelectorList& aOther) = delete;
 
         explicit SelectorList(mozilla::UniquePtr<RawServoSelectorList>&& aList)
           : mIsServo(true)
           , mServo(aList.release())
         {}
 
-#ifdef MOZ_OLD_STYLE
-        explicit SelectorList(mozilla::UniquePtr<nsCSSSelectorList>&& aList)
-          : mIsServo(false)
-          , mGecko(aList.release())
-        {}
-#endif
 
         ~SelectorList() {
           Reset();
         }
 
         bool IsServo() const { return mIsServo; }
         bool IsGecko() const { return !IsServo(); }
 
@@ -3870,20 +3859,18 @@ protected:
   nsString mLastModified;
 
   nsCOMPtr<nsIURI> mDocumentURI;
   nsCOMPtr<nsIURI> mOriginalURI;
   nsCOMPtr<nsIURI> mChromeXHRDocURI;
   nsCOMPtr<nsIURI> mDocumentBaseURI;
   nsCOMPtr<nsIURI> mChromeXHRDocBaseURI;
 
-#ifdef MOZ_STYLO
   // A lazily-constructed URL data for style system to resolve URL value.
   RefPtr<mozilla::URLExtraData> mCachedURLData;
-#endif
 
   nsWeakPtr mDocumentLoadGroup;
 
   bool mReferrerPolicySet;
   ReferrerPolicyEnum mReferrerPolicy;
 
   bool mBlockAllMixedContent;
   bool mBlockAllMixedContentPreloads;
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -20,19 +20,16 @@
 #include "mozilla/HTMLEditor.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TextEditor.h"
 #include "mozilla/TimeStamp.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/StyleRule.h"
-#endif
 #include "mozilla/dom/DocumentType.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/L10nUtilsBinding.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/PromiseNativeHandler.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "nsAttrValueOrString.h"
@@ -82,31 +79,25 @@
 #include "nsIWidget.h"
 #include "nsLayoutUtils.h"
 #include "nsNameSpaceManager.h"
 #include "nsNodeInfoManager.h"
 #include "nsNodeUtils.h"
 #include "nsPIBoxObject.h"
 #include "nsPIDOMWindow.h"
 #include "nsPresContext.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleProcessorData.h"
-#endif
 #include "nsString.h"
 #include "nsStyleConsts.h"
 #include "nsSVGUtils.h"
 #include "nsTextNode.h"
 #include "nsUnicharUtils.h"
 #include "nsXBLBinding.h"
 #include "nsXBLPrototypeBinding.h"
 #include "mozilla/Preferences.h"
 #include "xpcpublic.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRuleProcessor.h"
-#endif
 #include "nsCSSParser.h"
 #include "HTMLLegendElement.h"
 #include "nsWrapperCacheInlines.h"
 #include "WrapperFactory.h"
 #include <algorithm>
 #include "nsGlobalWindow.h"
 #include "nsDOMMutationObserver.h"
 #include "GeometryUtils.h"
@@ -2521,106 +2512,19 @@ nsINode::ParseServoSelectorList(
       NS_LITERAL_CSTRING("' is not a valid selector")
     );
   }
 
   cache.CacheList(aSelectorString, UniquePtr<RawServoSelectorList>(selectorList));
   return selectorList;
 }
 
-#ifdef MOZ_OLD_STYLE
-nsCSSSelectorList*
-nsINode::ParseSelectorList(const nsAString& aSelectorString,
-                           ErrorResult& aRv)
-{
-  nsIDocument* doc = OwnerDoc();
-  nsIDocument::SelectorCache& cache =
-    doc->GetSelectorCache(mozilla::StyleBackendType::Gecko);
-  nsIDocument::SelectorCache::SelectorList* list =
-    cache.GetList(aSelectorString);
-  if (list) {
-    if (!*list) {
-      // Invalid selector.
-      aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
-        NS_LITERAL_CSTRING("'") + NS_ConvertUTF16toUTF8(aSelectorString) +
-        NS_LITERAL_CSTRING("' is not a valid selector")
-      );
-      return nullptr;
-    }
-
-    return list->AsGecko();
-  }
-
-  nsCSSParser parser(doc->CSSLoader());
-
-  nsCSSSelectorList* selectorList = nullptr;
-  aRv = parser.ParseSelectorString(aSelectorString,
-                                   doc->GetDocumentURI(),
-                                   0, // XXXbz get the line number!
-                                   &selectorList);
-  if (aRv.Failed()) {
-    // We hit this for syntax errors, which are quite common, so don't
-    // use NS_ENSURE_SUCCESS.  (For example, jQuery has an extended set
-    // of selectors, but it sees if we can parse them first.)
-    MOZ_ASSERT(aRv.ErrorCodeIs(NS_ERROR_DOM_SYNTAX_ERR),
-               "Unexpected error, so cached version won't return it");
-
-    // Change the error message to match above.
-    aRv.ThrowDOMException(NS_ERROR_DOM_SYNTAX_ERR,
-      NS_LITERAL_CSTRING("'") + NS_ConvertUTF16toUTF8(aSelectorString) +
-      NS_LITERAL_CSTRING("' is not a valid selector")
-    );
-
-    cache.CacheList(aSelectorString, UniquePtr<nsCSSSelectorList>());
-    return nullptr;
-  }
-
-  // Filter out pseudo-element selectors from selectorList
-  nsCSSSelectorList** slot = &selectorList;
-  do {
-    nsCSSSelectorList* cur = *slot;
-    if (cur->mSelectors->IsPseudoElement()) {
-      *slot = cur->mNext;
-      cur->mNext = nullptr;
-      delete cur;
-    } else {
-      slot = &cur->mNext;
-    }
-  } while (*slot);
-
-  if (selectorList) {
-    NS_ASSERTION(selectorList->mSelectors,
-                 "How can we not have any selectors?");
-    cache.CacheList(aSelectorString, UniquePtr<nsCSSSelectorList>(selectorList));
-  } else {
-    // This is the "only pseudo-element selectors" case, which is
-    // not common, so just don't worry about caching it.  That way a
-    // null cached value can always indicate an invalid selector.
-  }
-
-  return selectorList;
-}
-
-static void
-AddScopeElements(TreeMatchContext& aMatchContext,
-                 nsINode* aMatchContextNode)
-{
-  if (aMatchContextNode->IsElement()) {
-    aMatchContext.SetHasSpecifiedScope();
-    aMatchContext.AddScopeElement(aMatchContextNode->AsElement());
-  }
-}
-#endif
 
 namespace {
 struct SelectorMatchInfo {
-#ifdef MOZ_OLD_STYLE
-  nsCSSSelectorList* const mSelectorList;
-  TreeMatchContext& mMatchContext;
-#endif
 };
 } // namespace
 
 // Given an id, find elements with that id under aRoot that match aMatchInfo if
 // any is provided.  If no SelectorMatchInfo is provided, just find the ones
 // with the given id.  aRoot must be in the document.
 template<bool onlyFirstMatch, class T>
 inline static void
@@ -2647,92 +2551,26 @@ FindMatchingElementsWithId(const nsAStri
   for (size_t i = 0; i < elements->Length(); ++i) {
     Element* element = (*elements)[i];
     if (!aRoot->IsElement() ||
         (element != aRoot &&
            nsContentUtils::ContentIsDescendantOf(element, aRoot))) {
       // We have an element with the right id and it's a strict descendant
       // of aRoot.  Make sure it really matches the selector.
       if (!aMatchInfo
-#ifdef MOZ_OLD_STYLE
-          || nsCSSRuleProcessor::SelectorListMatches(element,
-                                                     aMatchInfo->mMatchContext,
-                                                     aMatchInfo->mSelectorList)
-#endif
       ) {
         aList.AppendElement(element);
         if (onlyFirstMatch) {
           return;
         }
       }
     }
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-// Actually find elements matching aSelectorList (which must not be
-// null) and which are descendants of aRoot and put them in aList.  If
-// onlyFirstMatch, then stop once the first one is found.
-template<bool onlyFirstMatch, class Collector, class T>
-MOZ_ALWAYS_INLINE static void
-FindMatchingElements(nsINode* aRoot, nsCSSSelectorList* aSelectorList, T &aList,
-                     ErrorResult& aRv)
-{
-  nsIDocument* doc = aRoot->OwnerDoc();
-
-  TreeMatchContext matchingContext(false, nsRuleWalker::eRelevantLinkUnvisited,
-                                   doc, TreeMatchContext::eNeverMatchVisited);
-  AddScopeElements(matchingContext, aRoot);
-
-  // Fast-path selectors involving IDs.  We can only do this if aRoot
-  // is in the document and the document is not in quirks mode, since
-  // ID selectors are case-insensitive in quirks mode.  Also, only do
-  // this if aSelectorList only has one selector, because otherwise
-  // ordering the elements correctly is a pain.
-  NS_ASSERTION(aRoot->IsElement() || aRoot->IsNodeOfType(nsINode::eDOCUMENT) ||
-               !aRoot->IsInUncomposedDoc(),
-               "The optimization below to check ContentIsDescendantOf only for "
-               "elements depends on aRoot being either an element or a "
-               "document if it's in the document.");
-  if (aRoot->IsInUncomposedDoc() &&
-      doc->GetCompatibilityMode() != eCompatibility_NavQuirks &&
-      !aSelectorList->mNext &&
-      aSelectorList->mSelectors->mIDList) {
-    nsAtom* id = aSelectorList->mSelectors->mIDList->mAtom;
-    SelectorMatchInfo info = { aSelectorList, matchingContext };
-    FindMatchingElementsWithId<onlyFirstMatch, T>(nsDependentAtomString(id),
-                                                  aRoot, &info, aList);
-    return;
-  }
-
-  Collector results;
-  for (nsIContent* cur = aRoot->GetFirstChild();
-       cur;
-       cur = cur->GetNextNode(aRoot)) {
-    if (cur->IsElement() &&
-        nsCSSRuleProcessor::SelectorListMatches(cur->AsElement(),
-                                                matchingContext,
-                                                aSelectorList)) {
-      if (onlyFirstMatch) {
-        aList.AppendElement(cur->AsElement());
-        return;
-      }
-      results.AppendElement(cur->AsElement());
-    }
-  }
-
-  const uint32_t len = results.Length();
-  if (len) {
-    aList.SetCapacity(len);
-    for (uint32_t i = 0; i < len; ++i) {
-      aList.AppendElement(results.ElementAt(i));
-    }
-  }
-}
-#endif
 
 struct ElementHolder {
   ElementHolder() : mElement(nullptr) {}
   void AppendElement(Element* aElement) {
     MOZ_ASSERT(!mElement, "Should only get one element");
     mElement = aElement;
   }
   void SetCapacity(uint32_t aCapacity) { MOZ_CRASH("Don't call me!"); }
@@ -2752,28 +2590,17 @@ nsINode::QuerySelector(const nsAString& 
       if (!aList) {
         return nullptr;
       }
       const bool useInvalidation = false;
       return const_cast<Element*>(
           Servo_SelectorList_QueryFirst(this, aList, useInvalidation));
     },
     [&](nsCSSSelectorList* aList) -> Element* {
-#ifdef MOZ_OLD_STYLE
-      if (!aList) {
-        // Either we failed (and aResult already has the exception), or this
-        // is a pseudo-element-only selector that matches nothing.
-        return nullptr;
-      }
-      ElementHolder holder;
-      FindMatchingElements<true, ElementHolder>(this, aList, holder, aResult);
-      return holder.mElement;
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     }
   );
 }
 
 already_AddRefed<nsINodeList>
 nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult)
 {
   RefPtr<nsSimpleContentList> contentList = new nsSimpleContentList(this);
@@ -2785,25 +2612,17 @@ nsINode::QuerySelectorAll(const nsAStrin
       if (!aList) {
         return;
       }
       const bool useInvalidation = false;
       Servo_SelectorList_QueryAll(
         this, aList, contentList.get(), useInvalidation);
     },
     [&](nsCSSSelectorList* aList) {
-#ifdef MOZ_OLD_STYLE
-      if (!aList) {
-        return;
-      }
-      FindMatchingElements<false, AutoTArray<Element*, 128>>(
-        this, aList, *contentList, aResult);
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     }
   );
 
   return contentList.forget();
 }
 
 Element*
 nsINode::GetElementById(const nsAString& aId)
@@ -2930,23 +2749,21 @@ nsINode::IsApzAware() const
 }
 
 bool
 nsINode::IsNodeApzAwareInternal() const
 {
   return EventTarget::IsApzAware();
 }
 
-#ifdef MOZ_STYLO
 bool
 nsINode::IsStyledByServo() const
 {
   return OwnerDoc()->IsStyledByServo();
 }
-#endif
 
 DocGroup*
 nsINode::GetDocGroup() const
 {
   return OwnerDoc()->GetDocGroup();
 }
 
 class LocalizationHandler : public PromiseNativeHandler
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -1038,21 +1038,17 @@ public:
 
   virtual nsPIDOMWindowOuter* GetOwnerGlobalForBindings() override;
   virtual nsIGlobalObject* GetOwnerGlobal() const override;
 
   /**
    * Returns true if this is a node belonging to a document that uses the Servo
    * style system.
    */
-#ifdef MOZ_STYLO
   bool IsStyledByServo() const;
-#else
-  bool IsStyledByServo() const { return false; }
-#endif
 
   inline void UnsetRestyleFlagsIfGecko();
 
   /**
    * Adds a mutation observer to be notified when this node, or any of its
    * descendants, are modified. The node will hold a weak reference to the
    * observer, which means that it is the responsibility of the observer to
    * remove itself in case it dies before the node.  If an observer is added
@@ -2078,21 +2074,17 @@ protected:
     const nsAString& aSelectorString,
     mozilla::ErrorResult& aRv,
     const ServoFunctor& aServoFunctor,
     const GeckoFunctor& aGeckoFunctor)
   {
     if (IsStyledByServo()) {
       return aServoFunctor(ParseServoSelectorList(aSelectorString, aRv));
     }
-#ifdef MOZ_OLD_STYLE
-    return aGeckoFunctor(ParseSelectorList(aSelectorString, aRv));
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
 public:
   /* Event stuff that documents and elements share.  This needs to be
      NS_IMETHOD because some subclasses implement DOM methods with
      this exact name and signature and then the calling convention
      needs to match.
 
--- a/dom/base/nsMappedAttributeElement.cpp
+++ b/dom/base/nsMappedAttributeElement.cpp
@@ -2,24 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "nsMappedAttributeElement.h"
 #include "nsIDocument.h"
 
-#ifdef MOZ_OLD_STYLE
-nsresult
-nsMappedAttributeElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
-{
-  mAttrsAndChildren.WalkMappedAttributeStyleRules(aRuleWalker);
-  return NS_OK;
-}
-#endif
 
 bool
 nsMappedAttributeElement::SetAndSwapMappedAttribute(nsAtom* aName,
                                                     nsAttrValue& aValue,
                                                     bool* aValueWasSet,
                                                     nsresult* aRetval)
 {
   nsHTMLStyleSheet* sheet = OwnerDoc()->GetAttributeStyleSheet();
--- a/dom/base/nsMappedAttributeElement.h
+++ b/dom/base/nsMappedAttributeElement.h
@@ -34,19 +34,16 @@ protected:
   {}
 
 public:
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
 
   static void MapNoAttributesInto(const nsMappedAttributes* aAttributes,
                                   mozilla::GenericSpecifiedValues* aGenericData);
 
-#ifdef MOZ_OLD_STYLE
-  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override;
-#endif
   virtual bool SetAndSwapMappedAttribute(nsAtom* aName,
                                          nsAttrValue& aValue,
                                          bool* aValueWasSet,
                                          nsresult* aRetval) override;
 
   virtual void NodeInfoChanged(nsIDocument* aOldDoc) override;
 };
 
--- a/dom/base/nsMappedAttributes.cpp
+++ b/dom/base/nsMappedAttributes.cpp
@@ -6,20 +6,16 @@
 
 /*
  * A unique per-element set of attributes that is used as an
  * nsIStyleRule; used to implement presentational attributes.
  */
 
 #include "nsMappedAttributes.h"
 #include "nsHTMLStyleSheet.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleData.h"
-#include "nsRuleWalker.h"
-#endif
 #include "mozilla/GenericSpecifiedValues.h"
 #include "mozilla/HashFunctions.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/ServoDeclarationBlock.h"
 #include "mozilla/ServoSpecifiedValues.h"
 
 using namespace mozilla;
 
@@ -146,23 +142,16 @@ nsMappedAttributes::LastRelease()
       (*sCachedMappedAttributeAllocations)[mAttrCount] = memoryToCache;
       return;
     }
   }
 
   delete this;
 }
 
-#ifdef MOZ_OLD_STYLE
-NS_IMPL_ADDREF(nsMappedAttributes)
-NS_IMPL_RELEASE_WITH_DESTROY(nsMappedAttributes, LastRelease())
-
-NS_IMPL_QUERY_INTERFACE(nsMappedAttributes,
-                        nsIStyleRule)
-#endif
 
 void
 nsMappedAttributes::SetAndSwapAttr(nsAtom* aAttrName, nsAttrValue& aValue,
                                    bool* aValueWasSet)
 {
   NS_PRECONDITION(aAttrName, "null name");
   *aValueWasSet = false;
   uint32_t i;
@@ -253,66 +242,16 @@ void
 nsMappedAttributes::SetStyleSheet(nsHTMLStyleSheet* aSheet)
 {
   if (mSheet) {
     mSheet->DropMappedAttributes(this);
   }
   mSheet = aSheet;  // not ref counted
 }
 
-#ifdef MOZ_OLD_STYLE
-/* virtual */ void
-nsMappedAttributes::MapRuleInfoInto(nsRuleData* aRuleData)
-{
-  if (mRuleMapper) {
-    (*mRuleMapper)(this, aRuleData);
-  }
-}
-
-/* virtual */ bool
-nsMappedAttributes::MightMapInheritedStyleData()
-{
-  // Just assume that we do, rather than adding checks to all of the different
-  // kinds of attribute mapping functions we have.
-  return true;
-}
-
-/* virtual */ bool
-nsMappedAttributes::GetDiscretelyAnimatedCSSValue(nsCSSPropertyID aProperty,
-                                                  nsCSSValue* aValue)
-{
-  MOZ_ASSERT(false, "GetDiscretelyAnimatedCSSValue is not implemented yet");
-  return false;
-}
-
-#ifdef DEBUG
-/* virtual */ void
-nsMappedAttributes::List(FILE* out, int32_t aIndent) const
-{
-  nsAutoCString str;
-  nsAutoString tmp;
-  uint32_t i;
-
-  for (i = 0; i < mAttrCount; ++i) {
-    int32_t indent;
-    for (indent = aIndent; indent > 0; --indent) {
-      str.AppendLiteral("  ");
-    }
-
-    Attrs()[i].mName.GetQualifiedName(tmp);
-    LossyAppendUTF16toASCII(tmp, str);
-
-    Attrs()[i].mValue.ToString(tmp);
-    LossyAppendUTF16toASCII(tmp, str);
-    str.Append('\n');
-    fprintf_stderr(out, "%s", str.get());
-  }
-}
-#endif
-#endif
 
 void
 nsMappedAttributes::RemoveAttrAt(uint32_t aPos, nsAttrValue& aValue)
 {
   Attrs()[aPos].mValue.SwapValueWith(aValue);
   Attrs()[aPos].~InternalAttr();
   memmove(&Attrs()[aPos], &Attrs()[aPos + 1],
           (mAttrCount - aPos - 1) * sizeof(InternalAttr));
--- a/dom/base/nsMappedAttributes.h
+++ b/dom/base/nsMappedAttributes.h
@@ -9,44 +9,34 @@
  * nsIStyleRule; used to implement presentational attributes.
  */
 
 #ifndef nsMappedAttributes_h___
 #define nsMappedAttributes_h___
 
 #include "nsAttrAndChildArray.h"
 #include "nsMappedAttributeElement.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsIStyleRule.h"
-#endif
 #include "mozilla/Attributes.h"
 #include "mozilla/ServoBindingTypes.h"
 #include "mozilla/MemoryReporting.h"
 
 class nsAtom;
 class nsHTMLStyleSheet;
 
 class nsMappedAttributes final
-#ifdef MOZ_OLD_STYLE
-  : public nsIStyleRule
-#endif
 {
 public:
   nsMappedAttributes(nsHTMLStyleSheet* aSheet,
                      nsMapRuleToAttributesFunc aMapRuleFunc);
 
   // Do not return null.
   void* operator new(size_t size, uint32_t aAttrCount = 1) CPP_THROW_NEW;
   nsMappedAttributes* Clone(bool aWillAddAttr);
 
-#ifdef MOZ_OLD_STYLE
-  NS_DECL_ISUPPORTS
-#else
   NS_INLINE_DECL_REFCOUNTING_WITH_DESTROY(nsMappedAttributes, LastRelease())
-#endif
 
   void SetAndSwapAttr(nsAtom* aAttrName, nsAttrValue& aValue,
                       bool* aValueWasSet);
   const nsAttrValue* GetAttr(nsAtom* aAttrName) const;
   const nsAttrValue* GetAttr(const nsAString& aAttrName) const;
 
   uint32_t Count() const
   {
@@ -94,26 +84,16 @@ public:
     return mServoStyle;
   }
 
   void ClearServoStyle() {
     MOZ_ASSERT(NS_IsMainThread());
     mServoStyle = nullptr;
   }
 
-#ifdef MOZ_OLD_STYLE
-  // nsIStyleRule
-  virtual void MapRuleInfoInto(nsRuleData* aRuleData) override;
-  virtual bool MightMapInheritedStyleData() override;
-  virtual bool GetDiscretelyAnimatedCSSValue(nsCSSPropertyID aProperty,
-                                             nsCSSValue* aValue) override;
-#ifdef DEBUG
-  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const override;
-#endif
-#endif
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
   static void Shutdown();
 private:
 
   void LastRelease();
 
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -7,20 +7,16 @@
 #include "nsTreeSanitizer.h"
 
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/BindingStyleRule.h"
 #include "mozilla/DeclarationBlock.h"
 #include "mozilla/DeclarationBlockInlines.h"
 #include "mozilla/ServoDeclarationBlock.h"
 #include "mozilla/StyleSheetInlines.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/Declaration.h"
-#include "mozilla/css/StyleRule.h"
-#endif
 #include "mozilla/css/Rule.h"
 #include "mozilla/dom/CSSRuleList.h"
 #include "mozilla/dom/SRIMetadata.h"
 #include "nsCSSParser.h"
 #include "nsCSSPropertyID.h"
 #include "nsUnicharInputStream.h"
 #include "nsAttrName.h"
 #include "nsIScriptError.h"
@@ -1095,40 +1091,27 @@ nsTreeSanitizer::SanitizeStyleSheet(cons
   bool didSanitize = false;
   // Create a sheet to hold the parsed CSS
   RefPtr<StyleSheet> sheet;
   if (aDocument->IsStyledByServo()) {
     sheet = new ServoStyleSheet(mozilla::css::eAuthorSheetFeatures,
                                 CORS_NONE, aDocument->GetReferrerPolicy(),
                                 SRIMetadata());
   } else {
-#ifdef MOZ_OLD_STYLE
-    sheet = new CSSStyleSheet(mozilla::css::eAuthorSheetFeatures,
-                              CORS_NONE, aDocument->GetReferrerPolicy());
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
   sheet->SetURIs(aDocument->GetDocumentURI(), nullptr, aBaseURI);
   sheet->SetPrincipal(aDocument->NodePrincipal());
   if (aDocument->IsStyledByServo()) {
     sheet->AsServo()->ParseSheetSync(
       aDocument->CSSLoader(), NS_ConvertUTF16toUTF8(aOriginal),
       aDocument->GetDocumentURI(), aBaseURI, aDocument->NodePrincipal(),
       /* aLoadData = */ nullptr, 0, aDocument->GetCompatibilityMode());
   } else {
-#ifdef MOZ_OLD_STYLE
-    // Create the CSS parser, and parse the CSS text.
-    nsCSSParser parser(nullptr, sheet->AsGecko());
-    rv = parser.ParseSheet(aOriginal, aDocument->GetDocumentURI(),
-                           aBaseURI, aDocument->NodePrincipal(),
-                           /* aLoadData = */ nullptr, 0);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
   NS_ENSURE_SUCCESS(rv, true);
   // Mark the sheet as complete.
   MOZ_ASSERT(!sheet->HasForcedUniqueInner(),
              "should not get a forced unique inner during parsing");
   sheet->SetComplete();
   // Loop through all the rules found in the CSS text
   ErrorResult err;
@@ -1201,26 +1184,17 @@ nsTreeSanitizer::SanitizeAttributes(mozi
         if (document->IsStyledByServo()) {
           RefPtr<URLExtraData> urlExtra(aElement->GetURLDataForStyleAttr());
           decl = ServoDeclarationBlock::FromCssText(
               value,
               urlExtra,
               document->GetCompatibilityMode(),
               document->CSSLoader());
         } else {
-#ifdef MOZ_OLD_STYLE
-          // Pass the CSS Loader object to the parser, to allow parser error
-          // reports to include the outer window ID.
-          nsCSSParser parser(document->CSSLoader());
-          decl = parser.ParseStyleAttribute(value, document->GetDocumentURI(),
-                                            aElement->GetBaseURIForStyleAttr(),
-                                            document->NodePrincipal());
-#else
           MOZ_CRASH("old style system disabled");
-#endif
         }
         if (decl) {
           if (SanitizeStyleDeclaration(decl)) {
             nsAutoString cleanValue;
             decl->ToString(cleanValue);
             aElement->SetAttr(kNameSpaceID_None,
                               nsGkAtoms::style,
                               cleanValue,
--- a/dom/base/nsTreeSanitizer.h
+++ b/dom/base/nsTreeSanitizer.h
@@ -1,18 +1,15 @@
 /* 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 nsTreeSanitizer_h_
 #define nsTreeSanitizer_h_
 
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/StyleRule.h"
-#endif
 #include "nsIPrincipal.h"
 #include "mozilla/dom/Element.h"
 
 class nsIContent;
 
 /**
  * See the documentation of nsIParserUtils::sanitize for documentation
  * about the default behavior and the configuration options of this sanitizer.
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -22,24 +22,17 @@
 #include "nsIPresShell.h"
 
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIFrame.h"
 #include "nsError.h"
 
 #include "nsCSSParser.h"
 #include "nsCSSPseudoElements.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/StyleRule.h"
-#include "mozilla/css/Declaration.h"
-#endif
 #include "nsComputedDOMStyle.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 
 #include "nsPrintfCString.h"
 
 #include "nsReadableUtils.h"
 
 #include "nsColor.h"
 #include "nsGfxCIID.h"
 #include "nsIDocShell.h"
@@ -754,37 +747,23 @@ CanvasGradient::AddColorStop(float aOffs
   bool ok;
 
   nsIPresShell* shell = mContext ? mContext->GetPresShell() : nullptr;
   ServoStyleSet* servoStyleSet = shell && shell->StyleSet()
     ? shell->StyleSet()->GetAsServo()
     : nullptr;
 
   bool useServoParser =
-#ifdef MOZ_OLD_STYLE
-    servoStyleSet;
-#else
     true;
-#endif
 
   if (useServoParser) {
     ok = ServoCSSParser::ComputeColor(servoStyleSet, NS_RGB(0, 0, 0), aColorstr,
                                       &color);
   } else {
-#ifdef MOZ_OLD_STYLE
-    nsCSSValue value;
-    nsCSSParser parser;
-
-    nsPresContext* presContext = shell ? shell->GetPresContext() : nullptr;
-
-    ok = parser.ParseColorString(aColorstr, nullptr, 0, value) &&
-         nsRuleNode::ComputeColor(value, presContext, nullptr, color);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   if (!ok) {
     aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
     return;
   }
 
   mStops = nullptr;
@@ -1175,21 +1154,17 @@ CanvasRenderingContext2D::WrapObject(JSC
 bool
 CanvasRenderingContext2D::ParseColor(const nsAString& aString,
                                      nscolor* aColor)
 {
   nsIDocument* document = mCanvasElement ? mCanvasElement->OwnerDoc() : nullptr;
   css::Loader* loader = document ? document->CSSLoader() : nullptr;
 
   bool useServoParser =
-#ifdef MOZ_OLD_STYLE
-    document && document->IsStyledByServo();
-#else
     true;
-#endif
 
   if (useServoParser) {
     nsIPresShell* presShell = GetPresShell();
     ServoStyleSet* set = presShell ? presShell->StyleSet()->AsServo() : nullptr;
 
     // First, try computing the color without handling currentcolor.
     bool wasCurrentColor = false;
     if (!ServoCSSParser::ComputeColor(set, NS_RGB(0, 0, 0), aString, aColor,
@@ -1205,46 +1180,17 @@ CanvasRenderingContext2D::ParseColor(con
       if (canvasStyle) {
         *aColor = canvasStyle->StyleColor()->mColor;
       }
       // Beware that the presShell could be gone here.
     }
     return true;
   }
 
-#ifdef MOZ_OLD_STYLE
-  // Pass the CSS Loader object to the parser, to allow parser error
-  // reports to include the outer window ID.
-  nsCSSParser parser(loader);
-  nsCSSValue value;
-  if (!parser.ParseColorString(aString, nullptr, 0, value)) {
-    return false;
-  }
-
-  if (value.IsNumericColorUnit()) {
-    // if we already have a color we can just use it directly
-    *aColor = value.GetColorValue();
-  } else {
-    // otherwise resolve it
-    nsCOMPtr<nsIPresShell> presShell = GetPresShell();
-    RefPtr<nsStyleContext> parentContext;
-    if (mCanvasElement && mCanvasElement->IsInComposedDoc()) {
-      // Inherit from the canvas element.
-      parentContext =
-        nsComputedDOMStyle::GetStyleContext(mCanvasElement, nullptr);
-    }
-
-    Unused << nsRuleNode::ComputeColor(
-      value, presShell ? presShell->GetPresContext() : nullptr, parentContext,
-      *aColor);
-  }
-  return true;
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 nsresult
 CanvasRenderingContext2D::Reset()
 {
   if (mCanvasElement) {
     mCanvasElement->InvalidateCanvas();
   }
@@ -2686,171 +2632,16 @@ CanvasRenderingContext2D::SetShadowColor
 
   CurrentState().shadowColor = color;
 }
 
 //
 // filters
 //
 
-#ifdef MOZ_OLD_STYLE
-static already_AddRefed<Declaration>
-CreateDeclaration(nsINode* aNode,
-  const nsCSSPropertyID aProp1, const nsAString& aValue1, bool* aChanged1,
-  const nsCSSPropertyID aProp2, const nsAString& aValue2, bool* aChanged2)
-{
-  nsIPrincipal* principal = aNode->NodePrincipal();
-  nsIDocument* document = aNode->OwnerDoc();
-
-  nsIURI* docURL = document->GetDocumentURI();
-  nsIURI* baseURL = document->GetDocBaseURI();
-
-  // Pass the CSS Loader object to the parser, to allow parser error reports
-  // to include the outer window ID.
-  nsCSSParser parser(document->CSSLoader());
-
-  RefPtr<Declaration> declaration =
-    parser.ParseStyleAttribute(EmptyString(), docURL, baseURL, principal);
-
-  if (aProp1 != eCSSProperty_UNKNOWN) {
-    parser.ParseProperty(aProp1, aValue1, docURL, baseURL, principal,
-                         declaration, aChanged1, false);
-  }
-
-  if (aProp2 != eCSSProperty_UNKNOWN) {
-    parser.ParseProperty(aProp2, aValue2, docURL, baseURL, principal,
-                         declaration, aChanged2, false);
-  }
-
-  declaration->SetImmutable();
-  return declaration.forget();
-}
-
-static already_AddRefed<Declaration>
-CreateFontDeclaration(const nsAString& aFont,
-                      nsINode* aNode,
-                      bool* aOutFontChanged)
-{
-  bool lineHeightChanged;
-  return CreateDeclaration(aNode,
-    eCSSProperty_font, aFont, aOutFontChanged,
-    eCSSProperty_line_height, NS_LITERAL_STRING("normal"), &lineHeightChanged);
-}
-
-static already_AddRefed<GeckoStyleContext>
-GetFontParentStyleContext(Element* aElement,
-                          nsIPresShell* aPresShell,
-                          ErrorResult& aError)
-{
-  if (aElement && aElement->IsInComposedDoc()) {
-    // Inherit from the canvas element.
-    RefPtr<nsStyleContext> result =
-      nsComputedDOMStyle::GetStyleContext(aElement, nullptr);
-    if (!result) {
-      aError.Throw(NS_ERROR_FAILURE);
-      return nullptr;
-    }
-    return GeckoStyleContext::TakeRef(result.forget());
-  }
-
-  // otherwise inherit from default (10px sans-serif)
-
-  bool changed;
-  RefPtr<css::Declaration> parentRule =
-    CreateFontDeclaration(NS_LITERAL_STRING("10px sans-serif"),
-                          aPresShell->GetDocument(), &changed);
-
-  nsTArray<nsCOMPtr<nsIStyleRule>> parentRules;
-  parentRules.AppendElement(parentRule);
-
-  nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko();
-  MOZ_RELEASE_ASSERT(styleSet);
-
-  RefPtr<GeckoStyleContext> result =
-    styleSet->ResolveStyleForRules(nullptr, parentRules);
-
-  if (!result) {
-    aError.Throw(NS_ERROR_FAILURE);
-    return nullptr;
-  }
-  return result.forget();
-}
-
-static bool
-PropertyIsInheritOrInitial(Declaration* aDeclaration, const nsCSSPropertyID aProperty)
-{
-  // We know the declaration is not !important, so we can use
-  // GetNormalBlock().
-  const nsCSSValue* filterVal =
-    aDeclaration->GetNormalBlock()->ValueFor(aProperty);
-  return (!filterVal || (filterVal->GetUnit() == eCSSUnit_Unset ||
-                         filterVal->GetUnit() == eCSSUnit_Inherit ||
-                         filterVal->GetUnit() == eCSSUnit_Initial));
-}
-
-static already_AddRefed<GeckoStyleContext>
-GetFontStyleContext(Element* aElement, const nsAString& aFont,
-                    nsIPresShell* aPresShell,
-                    nsAString& aOutUsedFont,
-                    ErrorResult& aError)
-{
-  bool fontParsedSuccessfully = false;
-  RefPtr<css::Declaration> decl =
-    CreateFontDeclaration(aFont, aPresShell->GetDocument(),
-                          &fontParsedSuccessfully);
-
-  if (!fontParsedSuccessfully) {
-    // We got a syntax error.  The spec says this value must be ignored.
-    return nullptr;
-  }
-
-  // In addition to unparseable values, the spec says we need to reject
-  // 'inherit' and 'initial'. The easiest way to check for this is to look
-  // at font-size-adjust, which the font shorthand resets to either 'none' or
-  // '-moz-system-font'.
-  if (PropertyIsInheritOrInitial(decl, eCSSProperty_font_size_adjust)) {
-    return nullptr;
-  }
-
-  // have to get a parent style context for inherit-like relative
-  // values (2em, bolder, etc.)
-  RefPtr<GeckoStyleContext> parentContext =
-    GetFontParentStyleContext(aElement, aPresShell, aError);
-
-  if (aError.Failed()) {
-    aError.Throw(NS_ERROR_FAILURE);
-    return nullptr;
-  }
-
-  MOZ_RELEASE_ASSERT(parentContext,
-                     "GFX: GetFontParentStyleContext should have returned an error if it couldn't get a parent context.");
-
-  MOZ_ASSERT(!aPresShell->IsDestroying(),
-             "GetFontParentStyleContext should have returned an error if the presshell is being destroyed.");
-
-  nsTArray<nsCOMPtr<nsIStyleRule>> rules;
-  rules.AppendElement(decl);
-  // add a rule to prevent text zoom from affecting the style
-  rules.AppendElement(new nsDisableTextZoomStyleRule);
-
-  nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko();
-  MOZ_RELEASE_ASSERT(styleSet);
-
-  RefPtr<GeckoStyleContext> sc =
-    styleSet->ResolveStyleForRules(parentContext, rules);
-
-  // The font getter is required to be reserialized based on what we
-  // parsed (including having line-height removed).  (Older drafts of
-  // the spec required font sizes be converted to pixels, but that no
-  // longer seems to be required.)
-  decl->GetPropertyValueByID(eCSSProperty_font, aOutUsedFont);
-
-  return sc.forget();
-}
-#endif
 
 static already_AddRefed<RawServoDeclarationBlock>
 CreateDeclarationForServo(nsCSSPropertyID aProperty,
                           const nsAString& aPropertyValue,
                           nsIDocument* aDocument)
 {
   RefPtr<URLExtraData> data =
     new URLExtraData(aDocument->GetDocBaseURI(),
@@ -2950,62 +2741,16 @@ GetFontStyleForServo(Element* aElement, 
   // The font getter is required to be reserialized based on what we
   // parsed (including having line-height removed).  (Older drafts of
   // the spec required font sizes be converted to pixels, but that no
   // longer seems to be required.)
   Servo_SerializeFontValueForCanvas(declarations, &aOutUsedFont);
   return sc.forget();
 }
 
-#ifdef MOZ_OLD_STYLE
-static already_AddRefed<Declaration>
-CreateFilterDeclaration(const nsAString& aFilter,
-                        nsINode* aNode,
-                        bool* aOutFilterChanged)
-{
-  bool dummy;
-  return CreateDeclaration(aNode,
-    eCSSProperty_filter, aFilter, aOutFilterChanged,
-    eCSSProperty_UNKNOWN, EmptyString(), &dummy);
-}
-
-static already_AddRefed<GeckoStyleContext>
-ResolveFilterStyle(const nsAString& aFilterString,
-                   nsIPresShell* aPresShell,
-                   GeckoStyleContext* aParentContext,
-                   ErrorResult& aError)
-{
-  nsIDocument* document = aPresShell->GetDocument();
-  bool filterChanged = false;
-  RefPtr<css::Declaration> decl =
-    CreateFilterDeclaration(aFilterString, document, &filterChanged);
-
-  if (!filterChanged) {
-    // Refuse to accept the filter, but do not throw an error.
-    return nullptr;
-  }
-
-  // In addition to unparseable values, the spec says we need to reject
-  // 'inherit' and 'initial'.
-  if (PropertyIsInheritOrInitial(decl, eCSSProperty_filter)) {
-    return nullptr;
-  }
-
-  nsTArray<nsCOMPtr<nsIStyleRule>> rules;
-  rules.AppendElement(decl);
-
-  nsStyleSet* styleSet = aPresShell->StyleSet()->GetAsGecko();
-  MOZ_RELEASE_ASSERT(styleSet);
-
-  RefPtr<GeckoStyleContext> sc =
-    styleSet->ResolveStyleForRules(aParentContext, rules);
-
-  return sc.forget();
-}
-#endif
 
 static already_AddRefed<RawServoDeclarationBlock>
 CreateFilterDeclarationForServo(const nsAString& aFilter,
                                 nsIDocument* aDocument)
 {
   return CreateDeclarationForServo(eCSSProperty_filter, aFilter, aDocument);
 }
 
@@ -3052,36 +2797,18 @@ CanvasRenderingContext2D::ParseFilter(co
   nsCOMPtr<nsIPresShell> presShell = GetPresShell();
   if (!presShell) {
     aError.Throw(NS_ERROR_FAILURE);
     return false;
   }
 
   nsString usedFont;
   if (presShell->StyleSet()->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    RefPtr<GeckoStyleContext> parentContext =
-      GetFontStyleContext(mCanvasElement, GetFont(),
-                          presShell, usedFont, aError);
-    if (!parentContext) {
-      aError.Throw(NS_ERROR_FAILURE);
-      return false;
-    }
-    RefPtr<GeckoStyleContext> sc =
-      ResolveFilterStyle(aString, presShell, parentContext, aError);
-
-    if (!sc) {
-      return false;
-    }
-    aFilterChain = sc->StyleEffects()->mFilters;
-    return true;
-#else
     MOZ_CRASH("old style system disabled");
     return false;
-#endif
   }
 
   // For stylo
   MOZ_ASSERT(presShell->StyleSet()->IsServo());
 
   RefPtr<ServoStyleContext> parentStyle =
     GetFontStyleForServo(mCanvasElement,
                          GetFont(),
@@ -4009,22 +3736,17 @@ CanvasRenderingContext2D::SetFontInterna
   }
 
   RefPtr<nsStyleContext> sc;
   nsString usedFont;
   if (presShell->StyleSet()->IsServo()) {
     sc =
       GetFontStyleForServo(mCanvasElement, aFont, presShell, usedFont, aError);
   } else {
-#ifdef MOZ_OLD_STYLE
-    sc =
-      GetFontStyleContext(mCanvasElement, aFont, presShell, usedFont, aError);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
   if (!sc) {
     return false;
   }
 
   const nsStyleFont* fontStyle = sc->StyleFont();
   nsPresContext* c = presShell->GetPresContext();
 
--- a/dom/html/HTMLBodyElement.cpp
+++ b/dom/html/HTMLBodyElement.cpp
@@ -14,19 +14,16 @@
 #include "nsStyleConsts.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsIDocument.h"
 #include "nsIDocumentInlines.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsMappedAttributes.h"
 #include "nsIDocShell.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleWalker.h"
-#endif
 #include "nsGlobalWindow.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Body)
 
 namespace mozilla {
 namespace dom {
 
 //----------------------------------------------------------------------
--- a/dom/html/HTMLBodyElement.h
+++ b/dom/html/HTMLBodyElement.h
@@ -3,19 +3,16 @@
 /* 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 HTMLBodyElement_h___
 #define HTMLBodyElement_h___
 
 #include "mozilla/Attributes.h"
 #include "nsGenericHTMLElement.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsIStyleRule.h"
-#endif
 
 namespace mozilla {
 
 class TextEditor;
 
 namespace dom {
 
 class OnBeforeUnloadEventHandlerNonNull;
--- a/dom/html/HTMLHRElement.h
+++ b/dom/html/HTMLHRElement.h
@@ -6,19 +6,16 @@
 
 
 #ifndef mozilla_dom_HTMLHRElement_h
 #define mozilla_dom_HTMLHRElement_h
 
 #include "nsGenericHTMLElement.h"
 #include "nsMappedAttributes.h"
 #include "nsAttrValueInlines.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleData.h"
-#endif
 
 namespace mozilla {
 namespace dom {
 
 class HTMLHRElement final : public nsGenericHTMLElement
 {
 public:
   explicit HTMLHRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
--- a/dom/html/HTMLOptionsCollection.cpp
+++ b/dom/html/HTMLOptionsCollection.cpp
@@ -21,19 +21,16 @@
 #include "nsIComboboxControlFrame.h"
 #include "nsIDocument.h"
 #include "nsIFormControlFrame.h"
 #include "nsIForm.h"
 #include "nsIFormProcessor.h"
 #include "nsIListControlFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsMappedAttributes.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleData.h"
-#endif
 #include "nsServiceManagerUtils.h"
 #include "nsStyleConsts.h"
 #include "jsfriendapi.h"
 
 namespace mozilla {
 namespace dom {
 
 HTMLOptionsCollection::HTMLOptionsCollection(HTMLSelectElement* aSelect)
--- a/dom/html/HTMLSpanElement.h
+++ b/dom/html/HTMLSpanElement.h
@@ -7,19 +7,16 @@
 #ifndef mozilla_dom_HTMLSpanElement_h
 #define mozilla_dom_HTMLSpanElement_h
 
 #include "mozilla/Attributes.h"
 #include "nsGenericHTMLElement.h"
 #include "nsGkAtoms.h"
 #include "nsStyleConsts.h"
 #include "nsAtom.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleData.h"
-#endif
 
 namespace mozilla {
 namespace dom {
 
 class HTMLSpanElement final : public nsGenericHTMLElement
 {
 public:
   explicit HTMLSpanElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
--- a/dom/html/HTMLTableCellElement.cpp
+++ b/dom/html/HTMLTableCellElement.cpp
@@ -5,19 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/dom/HTMLTableCellElement.h"
 #include "mozilla/dom/HTMLTableElement.h"
 #include "mozilla/dom/HTMLTableRowElement.h"
 #include "mozilla/GenericSpecifiedValuesInlines.h"
 #include "nsMappedAttributes.h"
 #include "nsAttrValueInlines.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleWalker.h"
-#endif
 #include "celldata.h"
 #include "mozilla/dom/HTMLTableCellElementBinding.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(TableCell)
 
 namespace mozilla {
 namespace dom {
 
@@ -88,31 +85,16 @@ HTMLTableCellElement::CellIndex() const
     if (cells->Item(i) == this) {
       return i;
     }
   }
 
   return -1;
 }
 
-#ifdef MOZ_OLD_STYLE
-NS_IMETHODIMP
-HTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
-{
-  nsresult rv = nsGenericHTMLElement::WalkContentStyleRules(aRuleWalker);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (nsMappedAttributes* tableInheritedAttributes = GetMappedAttributesInheritedFromTable()) {
-    if (tableInheritedAttributes) {
-      aRuleWalker->Forward(tableInheritedAttributes);
-    }
-  }
-  return NS_OK;
-}
-#endif
 
 nsMappedAttributes*
 HTMLTableCellElement::GetMappedAttributesInheritedFromTable() const
 {
   if (HTMLTableElement* table = GetTable()) {
     return table->GetAttributesMappedForCell();
   }
 
--- a/dom/html/HTMLTableCellElement.h
+++ b/dom/html/HTMLTableCellElement.h
@@ -138,19 +138,16 @@ public:
   }
 
   virtual bool ParseAttribute(int32_t aNamespaceID,
                               nsAtom* aAttribute,
                               const nsAString& aValue,
                               nsIPrincipal* aMaybeScriptedPrincipal,
                               nsAttrValue& aResult) override;
   virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
-#ifdef MOZ_OLD_STYLE
-  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override;
-#endif
   NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
   // Get mapped attributes of ancestor table, if any
   nsMappedAttributes* GetMappedAttributesInheritedFromTable() const;
 
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                          bool aPreallocateChildren) const override;
 
 protected:
--- a/dom/html/HTMLTrackElement.cpp
+++ b/dom/html/HTMLTrackElement.cpp
@@ -30,19 +30,16 @@
 #include "nsIInterfaceRequestor.h"
 #include "nsILoadGroup.h"
 #include "nsIObserver.h"
 #include "nsIStreamListener.h"
 #include "nsISupportsImpl.h"
 #include "nsISupportsPrimitives.h"
 #include "nsMappedAttributes.h"
 #include "nsNetUtil.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleData.h"
-#endif
 #include "nsStyleConsts.h"
 #include "nsThreadUtils.h"
 #include "nsVideoFrame.h"
 
 static mozilla::LazyLogModule gTrackElementLog("nsTrackElement");
 #define LOG(type, msg) MOZ_LOG(gTrackElementLog, type, msg)
 
 // Replace the usual NS_IMPL_NS_NEW_HTML_ELEMENT(Track) so
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -18,19 +18,16 @@
 #include "nscore.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
 #include "nsCOMPtr.h"
 #include "nsAtom.h"
 #include "nsQueryObject.h"
 #include "nsIContentInlines.h"
 #include "nsIContentViewer.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/Declaration.h"
-#endif
 #include "nsIDocument.h"
 #include "nsIDocumentEncoder.h"
 #include "nsIDOMDocumentFragment.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMDocument.h"
 #include "nsMappedAttributes.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsIHTMLDocument.h"
@@ -2961,49 +2958,17 @@ nsGenericHTMLElement::NewURIFromString(c
 
 static bool
 IsOrHasAncestorWithDisplayNone(Element* aElement, nsIPresShell* aPresShell)
 {
   if (aPresShell->StyleSet()->IsServo()) {
     return !aElement->HasServoData() || Servo_Element_IsDisplayNone(aElement);
   }
 
-#ifdef MOZ_OLD_STYLE
-  AutoTArray<Element*, 10> elementsToCheck;
-  // Style and layout work on the flattened tree, so this is what we need to
-  // check in order to figure out whether we're in a display: none subtree.
-  for (Element* e = aElement; e; e = e->GetFlattenedTreeParentElement()) {
-    if (e->GetPrimaryFrame()) {
-      // e definitely isn't display:none and doesn't have a display:none
-      // ancestor.
-      break;
-    }
-    elementsToCheck.AppendElement(e);
-  }
-
-  if (elementsToCheck.IsEmpty()) {
-    return false;
-  }
-
-  nsStyleSet* styleSet = aPresShell->StyleSet()->AsGecko();
-  RefPtr<GeckoStyleContext> sc;
-  for (auto* element : Reversed(elementsToCheck)) {
-    if (sc) {
-      sc = styleSet->ResolveStyleFor(element, sc, LazyComputeBehavior::Assert);
-    } else {
-      sc = nsComputedDOMStyle::GetStyleContextNoFlush(element, nullptr)
-        .downcast<GeckoStyleContext>();
-    }
-    if (sc->StyleDisplay()->mDisplay == StyleDisplay::None) {
-      return true;
-    }
-  }
-#else
   MOZ_CRASH("Old style system disabled");
-#endif
 
   return false;
 }
 
 void
 nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
                                    mozilla::ErrorResult& aError)
 {
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2296,21 +2296,17 @@ ContentParent::InitInternal(ProcessPrior
   // at present.
   nsTArray<SystemFontListEntry> fontList;
   gfxPlatform::GetPlatform()->ReadSystemFontList(&fontList);
   nsTArray<LookAndFeelInt> lnfCache = LookAndFeel::GetIntCache();
 
   // Content processes have no permission to access profile directory, so we
   // send the file URL instead.
   StyleBackendType backendType =
-#ifdef MOZ_OLD_STYLE
-    StyleBackendType::Gecko;
-#else
     StyleBackendType::Servo;
-#endif
   StyleSheet* ucs = nsLayoutStylesheetCache::For(backendType)->UserContentSheet();
   if (ucs) {
     SerializeURI(ucs->GetSheetURI(), xpcomInit.userContentSheetURL());
   } else {
     SerializeURI(nullptr, xpcomInit.userContentSheetURL());
   }
 
   // 1. Build ContentDeviceData first, as it may affect some gfxVars.
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -7,19 +7,16 @@
 
 #include "nsMathMLElement.h"
 #include "base/compiler_specific.h"
 #include "mozilla/ArrayUtils.h"
 #include "nsGkAtoms.h"
 #include "nsITableCellLayout.h" // for MAX_COLSPAN / MAX_ROWSPAN
 #include "nsCRT.h"
 #include "nsLayoutStylesheetCache.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleData.h"
-#endif
 #include "nsCSSValue.h"
 #include "nsCSSParser.h"
 #include "nsMappedAttributes.h"
 #include "nsStyleConsts.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
 #include "nsPresContext.h"
 #include "mozAutoDocUpdate.h"
--- a/dom/smil/nsSMILCSSProperty.cpp
+++ b/dom/smil/nsSMILCSSProperty.cpp
@@ -70,25 +70,17 @@ nsSMILCSSProperty::GetBaseValue() const
   if (mElement->IsStyledByServo()) {
     computedValue.mServo =
       Servo_ComputedValues_ExtractAnimationValue(mBaseStyleContext->AsServo(), mPropID)
       .Consume();
     if (!computedValue.mServo) {
       return baseValue;
     }
   } else {
-#ifdef MOZ_OLD_STYLE
-    if (!StyleAnimationValue::ExtractComputedValue(mPropID,
-                                                   mBaseStyleContext->AsGecko(),
-                                                   computedValue.mGecko)) {
-      return baseValue;
-    }
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   baseValue =
     nsSMILCSSValueType::ValueFromAnimationValue(mPropID, mElement,
                                                 computedValue);
   return baseValue;
 }
 
--- a/dom/smil/nsSMILCSSValueType.cpp
+++ b/dom/smil/nsSMILCSSValueType.cpp
@@ -36,26 +36,18 @@ 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
   {
@@ -72,66 +64,30 @@ 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
-    sZeroFloat(0.0f,  StyleAnimationValue::FloatConstructor);
-  static const StyleAnimationValue
-    sZeroColor(NS_RGB(0,0,0), StyleAnimationValue::ColorConstructor);
-
-  MOZ_ASSERT(aUnit != StyleAnimationValue::eUnit_Null,
-             "Need non-null unit for a zero value");
-  switch (aUnit) {
-    case StyleAnimationValue::eUnit_Coord:
-      return &sZeroCoord;
-    case StyleAnimationValue::eUnit_Percent:
-      return &sZeroPercent;
-    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.
 //
@@ -156,71 +112,16 @@ 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;
-  }
-
-  if (!aValue1) {
-    aValue1 = GetZeroValueForUnit(aValue2->GetUnit());
-    return !!aValue1; // Fail if we have no zero value for this unit.
-  }
-  if (!aValue2) {
-    aValue2 = GetZeroValueForUnit(aValue1->GetUnit());
-    return !!aValue2; // Fail if we have no zero value for this unit.
-  }
-
-  // Ok, both values were specified.
-  // Need to handle a special-case, though: unitless nonzero length (parsed as
-  // eUnit_Float) mixed with unitless 0 length (parsed as eUnit_Coord).  These
-  // won't interoperate in StyleAnimationValue, since their Units don't match.
-  // In this case, we replace the eUnit_Coord 0 value with eUnit_Float 0 value.
-  const StyleAnimationValue& zeroCoord =
-    *GetZeroValueForUnit(StyleAnimationValue::eUnit_Coord);
-  if (*aValue1 == zeroCoord &&
-      aValue2->GetUnit() == StyleAnimationValue::eUnit_Float) {
-    aValue1 = GetZeroValueForUnit(StyleAnimationValue::eUnit_Float);
-  } else if (*aValue2 == zeroCoord &&
-             aValue1->GetUnit() == StyleAnimationValue::eUnit_Float) {
-    aValue2 = GetZeroValueForUnit(StyleAnimationValue::eUnit_Float);
-  }
-
-  return true;
-}
-
-static void
-InvertSign(StyleAnimationValue& aValue)
-{
-  switch (aValue.GetUnit()) {
-    case StyleAnimationValue::eUnit_Coord:
-      aValue.SetCoordValue(-aValue.GetCoordValue());
-      break;
-    case StyleAnimationValue::eUnit_Percent:
-      aValue.SetPercentValue(-aValue.GetPercentValue());
-      break;
-    case StyleAnimationValue::eUnit_Float:
-      aValue.SetFloatValue(-aValue.GetFloatValue());
-      break;
-    default:
-      NS_NOTREACHED("Calling InvertSign with an unsupported unit");
-      break;
-  }
-}
-#endif
 
 static ValueWrapper*
 ExtractValueWrapper(nsSMILValue& aValue)
 {
   return static_cast<ValueWrapper*>(aValue.mU.mPtr);
 }
 
 static const ValueWrapper*
@@ -408,46 +309,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?
-  // If so, update outparam to use the new value.
-  if (destWrapper && &destWrapper->mGeckoValue != destValue) {
-    destWrapper->mGeckoValue = *destValue;
-  }
-
-  // Handle barely-initialized "zero" destination.
-  if (!destWrapper) {
-    aDest.mU.mPtr = destWrapper = new ValueWrapper(property, *destValue);
-  }
-
-  // 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
@@ -514,62 +386,19 @@ nsSMILCSSValueType::ComputeDistance(cons
   const ValueWrapper* fromWrapper = ExtractValueWrapper(aFrom);
   const ValueWrapper* toWrapper = ExtractValueWrapper(aTo);
   MOZ_ASSERT(toWrapper, "expecting non-null endpoint");
 
   if (!toWrapper->mServoValues.IsEmpty()) {
     return ComputeDistanceForServo(fromWrapper, *toWrapper, aDistance);
   }
 
-#ifdef MOZ_OLD_STYLE
-  const StyleAnimationValue* fromCSSValue = fromWrapper ?
-    &fromWrapper->mGeckoValue : nullptr;
-  const StyleAnimationValue* toCSSValue = &toWrapper->mGeckoValue;
-  if (!FinalizeStyleAnimationValues(fromCSSValue, toCSSValue)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  return StyleAnimationValue::ComputeDistance(toWrapper->mPropID,
-                                              fromWrapper->mGeckoValue,
-                                              toWrapper->mGeckoValue,
-                                              nullptr,
-                                              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
-                                             : nullptr;
-  const StyleAnimationValue* endCSSValue = &aEndWrapper.mGeckoValue;
-  if (!FinalizeStyleAnimationValues(startCSSValue, endCSSValue)) {
-    return NS_ERROR_FAILURE;
-  }
-
-  StyleAnimationValue resultValue;
-  if (StyleAnimationValue::Interpolate(aEndWrapper.mPropID,
-                                       *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
@@ -639,99 +468,33 @@ 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) {
     // This can happen if we process certain types of restyles mid-sample
     // and remove anonymous animated content from the document as a result.
     // See bug 534975.
     return nullptr;
   }
   return doc->GetPresContext();
 }
 
-#ifdef MOZ_OLD_STYLE
-static const nsDependentSubstring
-GetNonNegativePropValue(const nsAString& aString, nsCSSPropertyID aPropID,
-                        bool& aIsNegative)
-{
-  // If value is negative, we'll strip off the "-" so the CSS parser won't
-  // barf, and then manually make the parsed value negative.
-  // (This is a partial solution to let us accept some otherwise out-of-bounds
-  // CSS values. Bug 501188 will provide a more complete fix.)
-  aIsNegative = false;
-  uint32_t subStringBegin = 0;
-
-  // NOTE: We need to opt-out 'stroke-dasharray' from the negative-number
-  // check.  Its values might look negative (e.g. by starting with "-1"), but
-  // they're more complicated than our simple negation logic here can handle.
-  if (aPropID != eCSSProperty_stroke_dasharray) {
-    int32_t absValuePos = nsSMILParserUtils::CheckForNegativeNumber(aString);
-    if (absValuePos > 0) {
-      aIsNegative = true;
-      subStringBegin = (uint32_t)absValuePos; // Start parsing after '-' sign
-    }
-  }
-
-  return Substring(aString, subStringBegin);
-}
-
-// Helper function to parse a string into a StyleAnimationValue
-static bool
-ValueFromStringHelper(nsCSSPropertyID aPropID,
-                      Element* aTargetElement,
-                      nsPresContext* aPresContext,
-                      mozilla::GeckoStyleContext* aStyleContext,
-                      const nsAString& aString,
-                      StyleAnimationValue& aStyleAnimValue,
-                      bool* aIsContextSensitive)
-{
-  bool isNegative = false;
-  const nsDependentSubstring subString =
-    GetNonNegativePropValue(aString, aPropID, isNegative);
-
-  if (!StyleAnimationValue::ComputeValue(aPropID, aTargetElement, aStyleContext,
-                                         subString, true, aStyleAnimValue,
-                                         aIsContextSensitive)) {
-    return false;
-  }
-  if (isNegative) {
-    InvertSign(aStyleAnimValue);
-  }
-
-  if (aPropID == eCSSProperty_font_size) {
-    // Divide out text-zoom, since SVG is supposed to ignore it
-    MOZ_ASSERT(aStyleAnimValue.GetUnit() == StyleAnimationValue::eUnit_Coord,
-               "'font-size' value with unexpected style unit");
-    aStyleAnimValue.SetCoordValue(aStyleAnimValue.GetCoordValue() /
-                                  aPresContext->EffectiveTextZoom());
-  }
-  return true;
-}
-#endif
 
 static ServoAnimationValues
 ValueFromStringHelper(nsCSSPropertyID aPropID,
                       Element* aTargetElement,
                       nsPresContext* aPresContext,
                       nsStyleContext* aStyleContext,
                       const nsAString& aString)
 {
@@ -804,27 +567,17 @@ nsSMILCSSValueType::ValueFromString(nsCS
 
     if (!parsedValues.IsEmpty()) {
       sSingleton.Init(aValue);
       aValue.mU.mPtr = new ValueWrapper(aPropID, Move(parsedValues));
     }
     return;
   }
 
-#ifdef MOZ_OLD_STYLE
-  StyleAnimationValue parsedValue;
-  if (ValueFromStringHelper(aPropID, aTargetElement, presContext,
-                            styleContext->AsGecko(), aString, parsedValue,
-                            aIsContextSensitive)) {
-    sSingleton.Init(aValue);
-    aValue.mU.mPtr = new ValueWrapper(aPropID, parsedValue);
-  }
-#else
     MOZ_CRASH("old style system disabled");
-#endif
 }
 
 // static
 nsSMILValue
 nsSMILCSSValueType::ValueFromAnimationValue(nsCSSPropertyID aPropID,
                                             Element* aTargetElement,
                                             const AnimationValue& aValue)
 {
@@ -859,25 +612,17 @@ 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,
@@ -939,21 +684,11 @@ 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/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -18,20 +18,16 @@
 #include "nsICSSDeclaration.h"
 #include "nsIContentInlines.h"
 #include "nsIDocument.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "mozAutoDocUpdate.h"
 #include "nsError.h"
 #include "nsIPresShell.h"
 #include "nsGkAtoms.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleWalker.h"
-#include "mozilla/css/Declaration.h"
-#endif
 #include "nsCSSProps.h"
 #include "nsCSSParser.h"
 #include "mozilla/EventListenerManager.h"
 #include "nsLayoutUtils.h"
 #include "nsSVGAnimatedTransformList.h"
 #include "nsSVGLength2.h"
 #include "nsSVGNumber2.h"
 #include "nsSVGNumberPair.h"
@@ -920,36 +916,16 @@ void
 nsSVGElement::NodeInfoChanged(nsIDocument* aOldDoc)
 {
   nsSVGElementBase::NodeInfoChanged(aOldDoc);
   aOldDoc->UnscheduleSVGForPresAttrEvaluation(this);
   mContentDeclarationBlock = nullptr;
   OwnerDoc()->ScheduleSVGForPresAttrEvaluation(this);
 }
 
-#ifdef MOZ_OLD_STYLE
-NS_IMETHODIMP
-nsSVGElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
-{
-#ifdef DEBUG
-//  printf("nsSVGElement(%p)::WalkContentStyleRules()\n", this);
-#endif
-  if (!mContentDeclarationBlock) {
-    UpdateContentDeclarationBlock(StyleBackendType::Gecko);
-  }
-
-  if (mContentDeclarationBlock) {
-    css::Declaration* declaration = mContentDeclarationBlock->AsGecko();
-    declaration->SetImmutable();
-    aRuleWalker->Forward(declaration);
-  }
-
-  return NS_OK;
-}
-#endif
 
 NS_IMETHODIMP_(bool)
 nsSVGElement::IsAttributeMapped(const nsAtom* name) const
 {
   if (name == nsGkAtoms::lang) {
     return true;
   }
   return nsSVGElementBase::IsAttributeMapped(name);
@@ -1181,19 +1157,16 @@ public:
   // already_AddRefed css::Declaration that incorporates the parsed
   // values. Otherwise, this method returns null.
   already_AddRefed<DeclarationBlock> GetDeclarationBlock();
 
 private:
   // MEMBER DATA
   // -----------
   css::Loader*      mLoader;
-#ifdef MOZ_OLD_STYLE
-  nsCSSParser       mParser;
-#endif
 
   // Arguments for nsCSSParser::ParseProperty
   nsIURI*           mDocURI;
   nsCOMPtr<nsIURI>  mBaseURI;
 
   // Declaration for storing parsed values (lazily initialized)
   RefPtr<DeclarationBlock> mDecl;
 
@@ -1204,19 +1177,16 @@ private:
 };
 
 MappedAttrParser::MappedAttrParser(css::Loader* aLoader,
                                    nsIURI* aDocURI,
                                    already_AddRefed<nsIURI> aBaseURI,
                                    nsSVGElement* aElement,
                                    StyleBackendType aBackend)
   : mLoader(aLoader)
-#ifdef MOZ_OLD_STYLE
-  , mParser(aLoader)
-#endif
   , mDocURI(aDocURI)
   , mBaseURI(aBaseURI)
   , mElement(aElement)
   , mBackend(aBackend)
 {
 }
 
 MappedAttrParser::~MappedAttrParser()
@@ -1227,40 +1197,30 @@ MappedAttrParser::~MappedAttrParser()
 }
 
 void
 MappedAttrParser::ParseMappedAttrValue(nsAtom* aMappedAttrName,
                                        const nsAString& aMappedAttrValue)
 {
   if (!mDecl) {
     if (mBackend == StyleBackendType::Gecko) {
-#ifdef MOZ_OLD_STYLE
-      mDecl = new css::Declaration();
-      mDecl->AsGecko()->InitializeEmpty();
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     } else {
       mDecl = new ServoDeclarationBlock();
     }
   }
 
   // Get the nsCSSPropertyID ID for our mapped attribute.
   nsCSSPropertyID propertyID =
     nsCSSProps::LookupProperty(nsDependentAtomString(aMappedAttrName),
                                CSSEnabledState::eForAllContent);
   if (propertyID != eCSSProperty_UNKNOWN) {
     bool changed = false; // outparam for ParseProperty.
     if (mBackend == StyleBackendType::Gecko) {
-#ifdef MOZ_OLD_STYLE
-      mParser.ParseProperty(propertyID, aMappedAttrValue, mDocURI, mBaseURI,
-                            mElement->NodePrincipal(), mDecl->AsGecko(), &changed, false, true);
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     } else {
       NS_ConvertUTF16toUTF8 value(aMappedAttrValue);
       // FIXME (bug 1343964): Figure out a better solution for sending the base uri to servo
       RefPtr<URLExtraData> data = new URLExtraData(mBaseURI, mDocURI,
                                                    mElement->NodePrincipal());
       changed = Servo_DeclarationBlock_SetPropertyById(
         mDecl->AsServo()->Raw(), propertyID, &value, false, data,
         ParsingMode::AllowUnitlessLength, mElement->OwnerDoc()->GetCompatibilityMode(), mLoader);
@@ -1287,26 +1247,17 @@ MappedAttrParser::ParseMappedAttrValue(n
     return;
   }
   MOZ_ASSERT(aMappedAttrName == nsGkAtoms::lang,
              "Only 'lang' should be unrecognized!");
   // nsCSSParser doesn't know about 'lang', so we need to handle it specially.
   if (aMappedAttrName == nsGkAtoms::lang) {
     propertyID = eCSSProperty__x_lang;
     if (mBackend == StyleBackendType::Gecko) {
-#ifdef MOZ_OLD_STYLE
-      nsCSSExpandedDataBlock block;
-      mDecl->AsGecko()->ExpandTo(&block);
-      nsCSSValue cssValue(PromiseFlatString(aMappedAttrValue), eCSSUnit_Ident);
-      block.AddLonghandProperty(propertyID, cssValue);
-      mDecl->AsGecko()->ValueAppended(propertyID);
-      mDecl->AsGecko()->CompressFrom(&block);
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     } else {
       RefPtr<nsAtom> atom = NS_Atomize(aMappedAttrValue);
       Servo_DeclarationBlock_SetIdentStringValue(mDecl->AsServo()->Raw(), propertyID, atom);
     }
   }
 }
 
 already_AddRefed<DeclarationBlock>
--- a/dom/svg/nsSVGElement.h
+++ b/dom/svg/nsSVGElement.h
@@ -107,20 +107,16 @@ public:
   virtual bool IsNodeOfType(uint32_t aFlags) const override;
 
   /**
    * We override the default to unschedule computation of Servo declaration blocks
    * when adopted across documents.
    */
   virtual void NodeInfoChanged(nsIDocument* aOldDoc) override;
 
-#ifdef MOZ_OLD_STYLE
-  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override;
-  void WalkAnimatedContentStyleRules(nsRuleWalker* aRuleWalker);
-#endif
 
   NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
 
   static const MappedAttributeEntry sFillStrokeMap[];
   static const MappedAttributeEntry sGraphicsMap[];
   static const MappedAttributeEntry sTextContentElementsMap[];
   static const MappedAttributeEntry sFontSpecificationMap[];
   static const MappedAttributeEntry sGradientStopMap[];
--- a/dom/xbl/nsBindingManager.cpp
+++ b/dom/xbl/nsBindingManager.cpp
@@ -31,20 +31,16 @@
 #include "nsXBLBinding.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsXBLDocumentInfo.h"
 #include "mozilla/dom/XBLChildrenElement.h"
 #ifdef MOZ_XUL
 #include "nsXULPrototypeCache.h"
 #endif
 
-#ifdef MOZ_OLD_STYLE
-#include "nsIStyleRuleProcessor.h"
-#include "nsRuleProcessorData.h"
-#endif
 #include "nsIWeakReference.h"
 
 #include "nsWrapperCacheInlines.h"
 #include "nsIXPConnect.h"
 #include "nsDOMCID.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsTHashtable.h"
 
@@ -673,58 +669,16 @@ nsBindingManager::GetBindingImplementati
       return rv;
     }
   }
 
   *aResult = nullptr;
   return NS_NOINTERFACE;
 }
 
-#ifdef MOZ_OLD_STYLE
-nsresult
-nsBindingManager::WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc,
-                            ElementDependentRuleProcessorData* aData,
-                            bool* aCutOffInheritance)
-{
-  *aCutOffInheritance = false;
-
-  NS_ASSERTION(aData->mElement, "How did that happen?");
-
-  // Walk the binding scope chain, starting with the binding attached to our
-  // content, up till we run out of scopes or we get cut off.
-  nsIContent *content = aData->mElement;
-
-  do {
-    nsXBLBinding *binding = content->GetXBLBinding();
-    if (binding) {
-      binding->WalkRules(aFunc, aData);
-      // If we're not looking at our original content, allow the binding to cut
-      // off style inheritance
-      if (content != aData->mElement) {
-        if (!binding->InheritsStyle()) {
-          // Go no further; we're not inheriting style from anything above here
-          break;
-        }
-      }
-    }
-
-    if (content->IsRootOfNativeAnonymousSubtree()) {
-      break; // Deliberately cut off style inheritance here.
-    }
-
-    content = content->GetBindingParent();
-  } while (content);
-
-  // If "content" is non-null that means we cut off inheritance at some point
-  // in the loop.
-  *aCutOffInheritance = (content != nullptr);
-
-  return NS_OK;
-}
-#endif
 
 bool
 nsBindingManager::EnumerateBoundContentBindings(
   const BoundContentBindingCallback& aCallback) const
 {
   if (!mBoundContentSet) {
     return true;
   }
@@ -745,54 +699,24 @@ nsBindingManager::EnumerateBoundContentB
         return false;
       }
     }
   }
 
   return true;
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-nsBindingManager::WalkAllRules(nsIStyleRuleProcessor::EnumFunc aFunc,
-                               ElementDependentRuleProcessorData* aData)
-{
-  EnumerateBoundContentBindings([=](nsXBLBinding* aBinding) {
-    nsIStyleRuleProcessor* ruleProcessor =
-      aBinding->PrototypeBinding()->GetRuleProcessor();
-    if (ruleProcessor) {
-      (*(aFunc))(ruleProcessor, aData);
-    }
-    return true;
-  });
-}
-#endif
 
 bool
 nsBindingManager::MediumFeaturesChanged(nsPresContext* aPresContext,
                                         mozilla::MediaFeatureChangeReason aReason)
 {
   MOZ_ASSERT(!mDocument->IsStyledByServo());
-#ifdef MOZ_OLD_STYLE
-  bool rulesChanged = false;
-  RefPtr<nsPresContext> presContext = aPresContext;
-  EnumerateBoundContentBindings([=, &rulesChanged](nsXBLBinding* aBinding) {
-    nsIStyleRuleProcessor* ruleProcessor =
-      aBinding->PrototypeBinding()->GetRuleProcessor();
-    if (ruleProcessor) {
-      bool thisChanged = ruleProcessor->MediumFeaturesChanged(presContext);
-      rulesChanged = rulesChanged || thisChanged;
-    }
-    return true;
-  });
-  return rulesChanged;
-#else
   MOZ_CRASH("old style system disabled");
   return false;
-#endif
 }
 
 void
 nsBindingManager::AppendAllSheets(nsTArray<StyleSheet*>& aArray)
 {
   EnumerateBoundContentBindings([&aArray](nsXBLBinding* aBinding) {
     aBinding->PrototypeBinding()->AppendStyleSheetsTo(aArray);
     return true;
--- a/dom/xbl/nsBindingManager.h
+++ b/dom/xbl/nsBindingManager.h
@@ -121,25 +121,16 @@ public:
   nsresult PutLoadingDocListener(nsIURI* aURL, nsIStreamListener* aListener);
   nsIStreamListener* GetLoadingDocListener(nsIURI* aURL);
   void RemoveLoadingDocListener(nsIURI* aURL);
 
   void FlushSkinBindings();
 
   nsresult GetBindingImplementation(nsIContent* aContent, REFNSIID aIID, void** aResult);
 
-#ifdef MOZ_OLD_STYLE
-  // Style rule methods
-  nsresult WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc,
-                     ElementDependentRuleProcessorData* aData,
-                     bool* aCutOffInheritance);
-
-  void WalkAllRules(nsIStyleRuleProcessor::EnumFunc aFunc,
-                    ElementDependentRuleProcessorData* aData);
-#endif
 
   // Do any processing that needs to happen as a result of a change in the
   // characteristics of the medium, and return whether this rule processor's
   // rules or the servo style set have changed (e.g., because of media
   // queries).
   bool MediumFeaturesChanged(nsPresContext* aPresContext,
                              mozilla::MediaFeatureChangeReason);
 
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -820,28 +820,16 @@ nsXBLBinding::InheritsStyle() const
     return mPrototypeBinding->InheritsStyle();
 
   if (mNextBinding)
     return mNextBinding->InheritsStyle();
 
   return true;
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-nsXBLBinding::WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc, void* aData)
-{
-  if (mNextBinding)
-    mNextBinding->WalkRules(aFunc, aData);
-
-  nsIStyleRuleProcessor *rules = mPrototypeBinding->GetRuleProcessor();
-  if (rules)
-    (*aFunc)(rules, aData);
-}
-#endif
 
 const RawServoAuthorStyles*
 nsXBLBinding::GetServoStyles() const
 {
   return mPrototypeBinding->GetServoStyles();
 }
 
 // Internal helper methods ////////////////////////////////////////////////////////////////
--- a/dom/xbl/nsXBLBinding.h
+++ b/dom/xbl/nsXBLBinding.h
@@ -5,19 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsXBLBinding_h_
 #define nsXBLBinding_h_
 
 #include "nsXBLService.h"
 #include "nsCOMPtr.h"
 #include "nsINodeList.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsIStyleRuleProcessor.h"
-#endif
 #include "nsClassHashtable.h"
 #include "nsTArray.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsISupportsImpl.h"
 #include "js/TypeDecls.h"
 
 class nsXBLPrototypeBinding;
 class nsIContent;
@@ -126,19 +123,16 @@ public:
   // object |obj|.  False return means a JS exception was set.
   bool ResolveAllFields(JSContext *cx, JS::Handle<JSObject*> obj) const;
 
   void AttributeChanged(nsAtom* aAttribute, int32_t aNameSpaceID,
                         bool aRemoveFlag, bool aNotify);
 
   void ChangeDocument(nsIDocument* aOldDocument, nsIDocument* aNewDocument);
 
-#ifdef MOZ_OLD_STYLE
-  void WalkRules(nsIStyleRuleProcessor::EnumFunc aFunc, void* aData);
-#endif
 
   const RawServoAuthorStyles* GetServoStyles() const;
 
   static nsresult DoInitJSClass(JSContext *cx, JS::Handle<JSObject*> obj,
                                 const nsString& aClassName,
                                 nsXBLPrototypeBinding* aProtoBinding,
                                 JS::MutableHandle<JSObject*> aClassObject,
                                 bool* aNew);
--- a/dom/xbl/nsXBLPrototypeBinding.cpp
+++ b/dom/xbl/nsXBLPrototypeBinding.cpp
@@ -34,19 +34,16 @@
 #include "nsXBLProtoImpl.h"
 #include "nsCRT.h"
 #include "nsContentUtils.h"
 #include "nsTextFragment.h"
 #include "nsTextNode.h"
 #include "nsIInterfaceInfo.h"
 #include "nsIScriptError.h"
 
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRuleProcessor.h"
-#endif
 #include "nsXBLResourceLoader.h"
 #include "mozilla/dom/CDATASection.h"
 #include "mozilla/dom/Comment.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 
 #ifdef MOZ_XUL
@@ -587,27 +584,16 @@ nsXBLPrototypeBinding::SetInitialAttribu
             curr = curr->GetNext();
           }
         }
       }
     }
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-nsIStyleRuleProcessor*
-nsXBLPrototypeBinding::GetRuleProcessor()
-{
-  if (mResources) {
-    return mResources->GetRuleProcessor();
-  }
-
-  return nullptr;
-}
-#endif
 
 void
 nsXBLPrototypeBinding::EnsureAttributeTable()
 {
   if (!mAttributeTable) {
     mAttributeTable =
         new nsClassHashtable<nsUint32HashKey, InnerAttributeTable>(2);
   }
--- a/dom/xbl/nsXBLPrototypeBinding.h
+++ b/dom/xbl/nsXBLPrototypeBinding.h
@@ -128,19 +128,16 @@ public:
   void AppendStyleSheet(mozilla::StyleSheet* aSheet);
   void RemoveStyleSheet(mozilla::StyleSheet* aSheet);
   void InsertStyleSheetAt(size_t aIndex, mozilla::StyleSheet* aSheet);
   mozilla::StyleSheet* StyleSheetAt(size_t aIndex) const;
   size_t SheetCount() const;
   bool HasStyleSheets() const;
   void AppendStyleSheetsTo(nsTArray<mozilla::StyleSheet*>& aResult) const;
 
-#ifdef MOZ_OLD_STYLE
-  nsIStyleRuleProcessor* GetRuleProcessor();
-#endif
 
   const RawServoAuthorStyles* GetServoStyles() const
   {
     return mResources ? mResources->GetServoStyles() : nullptr;
   }
 
   void SyncServoStyles()
   {
--- a/dom/xbl/nsXBLPrototypeResources.cpp
+++ b/dom/xbl/nsXBLPrototypeResources.cpp
@@ -1,31 +1,24 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
-#ifdef MOZ_OLD_STYLE
-#include "nsIStyleRuleProcessor.h"
-#endif
 #include "nsIDocument.h"
 #include "nsIContent.h"
 #include "nsIServiceManager.h"
 #include "nsXBLResourceLoader.h"
 #include "nsXBLPrototypeResources.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsIDocumentObserver.h"
 #include "mozilla/css/Loader.h"
 #include "nsIURI.h"
 #include "nsLayoutCID.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRuleProcessor.h"
-#include "nsStyleSet.h"
-#endif
 #include "mozilla/dom/URL.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 
 using namespace mozilla;
 using mozilla::dom::IsChromeURI;
 
@@ -117,21 +110,17 @@ nsXBLPrototypeResources::FlushSkinSheets
     //
     // FIXME(emilio): We shouldn't skip shadow root style updates just because?
     // Though during unlink is fine I guess...
     if (auto* shell = doc->GetShell()) {
       MOZ_ASSERT(shell->GetPresContext());
       ComputeServoStyles(*shell->StyleSet()->AsServo());
     }
   } else {
-#ifdef MOZ_OLD_STYLE
-    GatherRuleProcessor();
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   return NS_OK;
 }
 
 nsresult
 nsXBLPrototypeResources::Write(nsIObjectOutputStream* aStream)
 {
@@ -141,55 +130,31 @@ nsXBLPrototypeResources::Write(nsIObject
 }
 
 void
 nsXBLPrototypeResources::Traverse(nsCycleCollectionTraversalCallback &cb)
 {
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "proto mResources mLoader");
   cb.NoteXPCOMChild(mLoader);
 
-#ifdef MOZ_OLD_STYLE
-  CycleCollectionNoteChild(cb, mRuleProcessor.get(), "mRuleProcessor");
-#endif
   ImplCycleCollectionTraverse(cb, mStyleSheetList, "mStyleSheetList");
 }
 
 void
 nsXBLPrototypeResources::Unlink()
 {
   mStyleSheetList.Clear();
-#ifdef MOZ_OLD_STYLE
-  mRuleProcessor = nullptr;
-#endif
 }
 
 void
 nsXBLPrototypeResources::ClearLoader()
 {
   mLoader = nullptr;
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-nsXBLPrototypeResources::GatherRuleProcessor()
-{
-  nsTArray<RefPtr<CSSStyleSheet>> sheets(mStyleSheetList.Length());
-  for (StyleSheet* sheet : mStyleSheetList) {
-    MOZ_ASSERT(sheet->IsGecko(),
-               "GatherRuleProcessor must only be called for "
-               "nsXBLPrototypeResources objects with Gecko-flavored style "
-               "backends");
-    sheets.AppendElement(sheet->AsGecko());
-  }
-  mRuleProcessor = new nsCSSRuleProcessor(Move(sheets),
-                                          SheetType::Doc,
-                                          nullptr,
-                                          mRuleProcessor);
-}
-#endif
 
 void
 nsXBLPrototypeResources::SyncServoStyles()
 {
   mStyleRuleMap.reset(nullptr);
   mServoStyles.reset(Servo_AuthorStyles_Create());
   for (auto& sheet : mStyleSheetList) {
     Servo_AuthorStyles_AppendStyleSheet(mServoStyles.get(), sheet->AsServo());
@@ -249,19 +214,16 @@ MOZ_DEFINE_MALLOC_ENCLOSING_SIZE_OF(Serv
 size_t
 nsXBLPrototypeResources::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
   n += mStyleSheetList.ShallowSizeOfExcludingThis(aMallocSizeOf);
   for (const auto& sheet : mStyleSheetList) {
     n += sheet->SizeOfIncludingThis(aMallocSizeOf);
   }
-#ifdef MOZ_OLD_STYLE
-  n += mRuleProcessor ? mRuleProcessor->SizeOfIncludingThis(aMallocSizeOf) : 0;
-#endif
   n += mServoStyles ? Servo_AuthorStyles_SizeOfIncludingThis(
       ServoAuthorStylesMallocSizeOf,
       ServoAuthorStylesMallocEnclosingSizeOf,
       mServoStyles.get()) : 0;
   n += mStyleRuleMap ? mStyleRuleMap->SizeOfIncludingThis(aMallocSizeOf) : 0;
 
   // Measurement of the following members may be added later if DMD finds it
   // is worthwhile:
--- a/dom/xbl/nsXBLPrototypeResources.h
+++ b/dom/xbl/nsXBLPrototypeResources.h
@@ -62,26 +62,16 @@ public:
 
   bool HasStyleSheets() const
   {
     return !mStyleSheetList.IsEmpty();
   }
 
   void AppendStyleSheetsTo(nsTArray<mozilla::StyleSheet*>& aResult) const;
 
-#ifdef MOZ_OLD_STYLE
-  /**
-   * Recreates mRuleProcessor to represent the current list of style sheets
-   * stored in mStyleSheetList.  (Named GatherRuleProcessor to parallel
-   * nsStyleSet::GatherRuleProcessors.)
-   */
-  void GatherRuleProcessor();
-
-  nsCSSRuleProcessor* GetRuleProcessor() const { return mRuleProcessor; }
-#endif
 
   const RawServoAuthorStyles* GetServoStyles() const
   {
     return mServoStyles.get();
   }
 
   void SyncServoStyles();
 
@@ -99,20 +89,16 @@ private:
   RefPtr<nsXBLResourceLoader> mLoader;
 
   // A list of loaded stylesheets for this binding.
   //
   // FIXME(emilio): Remove when the old style system is gone, defer to
   // mServoStyles.
   nsTArray<RefPtr<mozilla::StyleSheet>> mStyleSheetList;
 
-#ifdef MOZ_OLD_STYLE
-  // The list of stylesheets converted to a rule processor.
-  RefPtr<nsCSSRuleProcessor> mRuleProcessor;
-#endif
 
   // The result of cascading the XBL style sheets like mRuleProcessor, but
   // for the Servo style backend.
   mozilla::UniquePtr<RawServoAuthorStyles> mServoStyles;
   mozilla::UniquePtr<mozilla::ServoStyleRuleMap> mStyleRuleMap;
 };
 
 #endif
--- a/dom/xbl/nsXBLResourceLoader.cpp
+++ b/dom/xbl/nsXBLResourceLoader.cpp
@@ -2,19 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "nsCSSFrameConstructor.h"
 #include "nsTArray.h"
 #include "nsString.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsIStyleRuleProcessor.h"
-#endif
 #include "nsIDocument.h"
 #include "nsIContent.h"
 #include "nsIPresShell.h"
 #include "nsXBLService.h"
 #include "nsIServiceManager.h"
 #include "nsXBLResourceLoader.h"
 #include "nsXBLPrototypeResources.h"
 #include "nsIDocumentObserver.h"
@@ -23,23 +20,17 @@
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/css/Loader.h"
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsGkAtoms.h"
 #include "nsStyleContext.h"
 #include "nsXBLPrototypeBinding.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRuleProcessor.h"
-#endif
 #include "nsContentUtils.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "nsIScriptSecurityManager.h"
 
 using namespace mozilla;
 
 NS_IMPL_CYCLE_COLLECTION(nsXBLResourceLoader, mBoundElements)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXBLResourceLoader)
   NS_INTERFACE_MAP_ENTRY(nsICSSLoaderObserver)
@@ -187,21 +178,17 @@ nsXBLResourceLoader::StyleSheetLoaded(St
   mResources->AppendStyleSheet(aSheet);
 
   if (!mInLoadResourcesFunc)
     mPendingSheets--;
 
   if (mPendingSheets == 0) {
     // All stylesheets are loaded.
     if (aSheet->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-      mResources->GatherRuleProcessor();
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     } else {
       mResources->ComputeServoStyles(
         *mBoundDocument->GetShell()->StyleSet()->AsServo());
     }
 
     // XXX Check for mPendingScripts when scripts also come online.
     if (!mInLoadResourcesFunc)
       NotifyBoundElements();
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -31,35 +31,29 @@
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsIPresShell.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptContext.h"
 #include "nsIScriptError.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIServiceManager.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/StyleRule.h"
-#endif
 #include "nsIURL.h"
 #include "nsViewManager.h"
 #include "nsIWidget.h"
 #include "nsLayoutCID.h"
 #include "nsContentCID.h"
 #include "mozilla/dom/Event.h"
 #include "nsStyleConsts.h"
 #include "nsString.h"
 #include "nsXULControllers.h"
 #include "nsIBoxObject.h"
 #include "nsPIBoxObject.h"
 #include "XULDocument.h"
 #include "nsXULPopupListener.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleWalker.h"
-#endif
 #include "nsCSSParser.h"
 #include "ListBoxObject.h"
 #include "nsContentUtils.h"
 #include "nsContentList.h"
 #include "mozilla/InternalMutationEvent.h"
 #include "mozilla/MouseEvents.h"
 #include "nsPIDOMWindow.h"
 #include "nsJSPrincipals.h"
@@ -1438,23 +1432,16 @@ nsXULElement::PreHandleEvent(EventChainV
         return DispatchXULCommand(aVisitor, command);
     }
     return nsStyledElement::PreHandleEvent(aVisitor);
 }
 
 //----------------------------------------------------------------------
 // Implementation methods
 
-#ifdef MOZ_OLD_STYLE
-NS_IMETHODIMP
-nsXULElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker)
-{
-    return NS_OK;
-}
-#endif
 
 nsChangeHint
 nsXULElement::GetAttributeChangeHint(const nsAtom* aAttribute,
                                      int32_t aModType) const
 {
     nsChangeHint retval(nsChangeHint(0));
 
     if (aAttribute == nsGkAtoms::value &&
@@ -2385,23 +2372,17 @@ nsXULPrototypeElement::SetAttrAt(uint32_
         RefPtr<DeclarationBlock> declaration;
         if (nsLayoutUtils::StyloEnabled() &&
             nsLayoutUtils::ShouldUseStylo(principal)) {
           RefPtr<URLExtraData> data =
             new URLExtraData(aDocumentURI, aDocumentURI, principal);
           declaration = ServoDeclarationBlock::FromCssText(
               aValue, data, eCompatibility_FullStandards, nullptr);
         } else {
-#ifdef MOZ_OLD_STYLE
-          nsCSSParser parser;
-          declaration = parser.ParseStyleAttribute(aValue, aDocumentURI,
-                                                   aDocumentURI, principal);
-#else
           MOZ_CRASH("old style system disabled");
-#endif
         }
         if (declaration) {
             mAttributes[aPos].mValue.SetTo(declaration.forget(), &aValue);
 
             return NS_OK;
         }
         // Don't abort if parsing failed, it could just be malformed css.
     }
--- a/dom/xul/nsXULElement.h
+++ b/dom/xul/nsXULElement.h
@@ -384,19 +384,16 @@ public:
     nsIContent* GetBindingParent() const final
     {
       return mBindingParent;
     }
 
     virtual bool IsNodeOfType(uint32_t aFlags) const override;
     virtual bool IsFocusableInternal(int32_t* aTabIndex, bool aWithMouse) override;
 
-#ifdef MOZ_OLD_STYLE
-    NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) override;
-#endif
     virtual nsChangeHint GetAttributeChangeHint(const nsAtom* aAttribute,
                                                 int32_t aModType) const override;
     NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
 
     // nsIDOMXULElement
     NS_DECL_NSIDOMXULELEMENT
 
     virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
--- a/editor/libeditor/CSSEditUtils.cpp
+++ b/editor/libeditor/CSSEditUtils.cpp
@@ -5,19 +5,16 @@
 
 #include "mozilla/CSSEditUtils.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/ChangeStyleTransaction.h"
 #include "mozilla/HTMLEditor.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/DeclarationBlockInlines.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/StyleRule.h"
-#endif
 #include "mozilla/dom/Element.h"
 #include "mozilla/mozalloc.h"
 #include "nsAString.h"
 #include "nsCOMPtr.h"
 #include "nsColor.h"
 #include "nsComputedDOMStyle.h"
 #include "nsDebug.h"
 #include "nsDependentSubstring.h"
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -3002,21 +3002,17 @@ HTMLEditor::EnableExistingStyleSheet(con
   nsCOMPtr<nsIDocument> document = GetDocument();
   sheet->SetAssociatedDocument(document, StyleSheet::NotOwnedByDocument);
 
   if (sheet->IsServo()) {
     // XXXheycam ServoStyleSheets don't support being enabled/disabled yet.
     NS_ERROR("stylo: ServoStyleSheets can't be disabled yet");
     return true;
   }
-#ifdef MOZ_OLD_STYLE
-  sheet->AsGecko()->SetDisabled(false);
-#else
   MOZ_CRASH("old style system disabled");
-#endif
   return true;
 }
 
 nsresult
 HTMLEditor::AddNewStyleSheetToList(const nsAString& aURL,
                                    StyleSheet* aStyleSheet)
 {
   uint32_t countSS = mStyleSheets.Length();
--- a/gfx/layers/AnimationHelper.cpp
+++ b/gfx/layers/AnimationHelper.cpp
@@ -127,75 +127,16 @@ 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() ||
-               aSegment.mToValue.mGecko.IsNull() ||
-               aSegment.mFromValue.mGecko.GetUnit() ==
-                 aSegment.mToValue.mGecko.GetUnit(),
-               "Must have same unit");
-
-  StyleAnimationValue startValue =
-    dom::KeyframeEffectReadOnly::CompositeValue(aAnimation.property(),
-                                                aSegment.mFromValue.mGecko,
-                                                aUnderlyingValue,
-                                                aSegment.mFromComposite);
-  StyleAnimationValue endValue =
-    dom::KeyframeEffectReadOnly::CompositeValue(aAnimation.property(),
-                                                aSegment.mToValue.mGecko,
-                                                aUnderlyingValue,
-                                                aSegment.mToComposite);
-
-  // Iteration composition for accumulate
-  if (static_cast<dom::IterationCompositeOperation>
-        (aAnimation.iterationComposite()) ==
-          dom::IterationCompositeOperation::Accumulate &&
-      aCurrentIteration > 0) {
-    // FIXME: Bug 1293492: Add a utility function to calculate both of
-    // below StyleAnimationValues.
-    startValue =
-      StyleAnimationValue::Accumulate(aAnimation.property(),
-                                      aLastValue.IsNull()
-                                        ? aUnderlyingValue
-                                        : aLastValue,
-                                      Move(startValue),
-                                      aCurrentIteration);
-    endValue =
-      StyleAnimationValue::Accumulate(aAnimation.property(),
-                                      aLastValue.IsNull()
-                                        ? aUnderlyingValue
-                                        : aLastValue,
-                                      Move(endValue),
-                                      aCurrentIteration);
-  }
-
-  StyleAnimationValue interpolatedValue;
-  // This should never fail because we only pass transform and opacity values
-  // 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)
@@ -273,40 +214,28 @@ 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
-#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();
-#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();
@@ -475,21 +404,17 @@ CreateCSSValueList(const InfallibleTArra
     result->mValue.SetNoneValue();
   }
   return new nsCSSValueSharedList(result.forget());
 }
 
 static AnimationValue
 ToAnimationValue(const Animatable& aAnimatable)
 {
-#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/gfx/layers/apz/util/ActiveElementManager.cpp
+++ b/gfx/layers/apz/util/ActiveElementManager.cpp
@@ -9,19 +9,16 @@
 #include "mozilla/EventStates.h"
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/StyleSetHandleInlines.h"
 #include "mozilla/Preferences.h"
 #include "base/message_loop.h"
 #include "base/task.h"
 #include "mozilla/dom/Element.h"
 #include "nsIDocument.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 
 #define AEM_LOG(...)
 // #define AEM_LOG(...) printf_stderr("AEM: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
 
 static int32_t sActivationDelayMs = 100;
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -178,19 +178,16 @@
 #include "nsIDragSession.h"
 #include "nsIFrameInlines.h"
 #include "mozilla/gfx/2D.h"
 #include "nsSubDocumentFrame.h"
 #include "nsQueryObject.h"
 #include "nsLayoutStylesheetCache.h"
 #include "mozilla/layers/InputAPZContext.h"
 #include "mozilla/layers/FocusTarget.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/StyleSetHandleInlines.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/dom/ImageTracker.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsBindingManager.h"
 #include "nsClassHashtable.h"
@@ -607,22 +604,17 @@ bool PresShell::sProcessInteractable = f
 static void
 VerifyStyleTree(nsPresContext* aPresContext, nsFrameManager* aFrameManager)
 {
   if (nsFrame::GetVerifyStyleTreeEnable()) {
     if (aPresContext->RestyleManager()->IsServo()) {
       NS_ERROR("stylo: cannot verify style tree with a ServoRestyleManager");
       return;
     }
-#ifdef MOZ_OLD_STYLE
-    nsIFrame* rootFrame = aFrameManager->GetRootFrame();
-    aPresContext->RestyleManager()->AsGecko()->DebugVerifyStyleTree(rootFrame);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 }
 #define VERIFY_STYLE_TREE ::VerifyStyleTree(mPresContext, mFrameConstructor)
 #else
 #define VERIFY_STYLE_TREE
 #endif
 
 static bool gVerifyReflowEnabled;
@@ -4393,31 +4385,17 @@ PresShell::DocumentStatesChanged(nsIDocu
   NS_PRECONDITION(!mIsDocumentGone, "Unexpected DocumentStatesChanged");
   NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument");
   MOZ_ASSERT(!aStateMask.IsEmpty());
 
   if (mDidInitialize) {
     if (mStyleSet->IsServo()) {
       mStyleSet->AsServo()->InvalidateStyleForDocumentStateChanges(aStateMask);
     } else {
-#ifdef MOZ_OLD_STYLE
-      if (Element* rootElement = aDocument->GetRootElement()) {
-        const bool needRestyle =
-          mStyleSet->AsGecko()->HasDocumentStateDependentStyle(
-            rootElement, aStateMask);
-        if (needRestyle) {
-          mPresContext->RestyleManager()->PostRestyleEvent(rootElement,
-                                                           eRestyle_Subtree,
-                                                           nsChangeHint(0));
-          VERIFY_STYLE_TREE;
-        }
-      }
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     }
   }
 
   if (aStateMask.HasState(NS_DOCUMENT_STATE_WINDOW_INACTIVE)) {
     if (nsIFrame* root = mFrameConstructor->GetRootFrame()) {
       root->SchedulePaint();
     }
   }
@@ -9616,25 +9594,16 @@ CopySheetsIntoClone(StyleSetHandle aSet,
   n = aSet->SheetCount(SheetType::Agent);
   for (i = 0; i < n; i++) {
     StyleSheet* ss = aSet->StyleSheetAt(SheetType::Agent, i);
     if (ss)
       aClone->AppendStyleSheet(SheetType::Agent, ss);
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-nsStyleSet*
-PresShell::CloneStyleSet(nsStyleSet* aSet)
-{
-  nsStyleSet* clone = new nsStyleSet();
-  CopySheetsIntoClone(aSet, clone);
-  return clone;
-}
-#endif
 
 ServoStyleSet*
 PresShell::CloneStyleSet(ServoStyleSet* aSet)
 {
   ServoStyleSet* clone = new ServoStyleSet();
   CopySheetsIntoClone(aSet, clone);
   return clone;
 }
@@ -9684,37 +9653,26 @@ PresShell::VerifyIncrementalReflow()
   vm->SetRootView(view);
 
   // Make the new presentation context the same size as our
   // presentation context.
   cx->SetVisibleArea(mPresContext->GetVisibleArea());
 
   // Create a new presentation shell to view the document. Use the
   // exact same style information that this document has.
-#ifdef MOZ_OLD_STYLE
-  nsAutoPtr<nsStyleSet> newGeckoSet;
-#endif
   nsAutoPtr<ServoStyleSet> newServoSet;
   StyleSetHandle newSet;
   if (mStyleSet->IsServo()) {
     newServoSet = CloneStyleSet(mStyleSet->AsServo());
     newSet = newServoSet;
   } else {
-#ifdef MOZ_OLD_STYLE
-    newGeckoSet = CloneStyleSet(mStyleSet->AsGecko());
-    newSet = newGeckoSet;
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
   nsCOMPtr<nsIPresShell> sh = mDocument->CreateShell(cx, vm, newSet);
   NS_ENSURE_TRUE(sh, false);
-#ifdef MOZ_OLD_STYLE
-  newGeckoSet.forget();
-#endif
   newServoSet.forget();
   // Note that after we create the shell, we must make sure to destroy it
   sh->SetVerifyReflowEnable(false); // turn off verify reflow while we're reflowing the test frame tree
   vm->SetPresShell(sh);
   {
     nsAutoCauseReflowNotifier crNotifier(this);
     sh->Initialize();
   }
@@ -10434,21 +10392,17 @@ PresShell::AddSizeOfIncludingThis(nsWind
   if (mCaret) {
     aSizes.mLayoutPresShellSize += mCaret->SizeOfIncludingThis(mallocSizeOf);
   }
   aSizes.mLayoutPresShellSize +=
     mApproximatelyVisibleFrames.ShallowSizeOfExcludingThis(mallocSizeOf) +
     mFramesToDirty.ShallowSizeOfExcludingThis(mallocSizeOf);
 
   if (StyleSet()->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    StyleSet()->AsGecko()->AddSizeOfIncludingThis(aSizes);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   } else {
     StyleSet()->AsServo()->AddSizeOfIncludingThis(aSizes);
   }
 
   aSizes.mLayoutTextRunsSize += SizeOfTextRuns(mallocSizeOf);
 
   aSizes.mLayoutPresContextSize +=
     mPresContext->SizeOfIncludingThis(mallocSizeOf);
@@ -10639,24 +10593,17 @@ ToSheetType(uint32_t aServiceSheetType)
 }
 
 nsresult
 nsIPresShell::HasRuleProcessorUsedByMultipleStyleSets(uint32_t aSheetType,
                                                       bool* aRetVal)
 {
   *aRetVal = false;
   if (mStyleSet->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    nsStyleSet* styleSet = mStyleSet->AsGecko();
-    // ServoStyleSets do not have rule processors.
-    SheetType type = ToSheetType(aSheetType);
-    *aRetVal = styleSet->HasRuleProcessorUsedByMultipleStyleSets(type);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
   return NS_OK;
 }
 
 void
 PresShell::NotifyStyleSheetServiceSheetAdded(StyleSheet* aSheet,
                                              uint32_t aSheetType)
 {
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -503,19 +503,16 @@ private:
 
   void SetRenderingState(const RenderingState& aState);
 
   friend class ::nsPresShellEventCB;
 
   bool mCaretEnabled;
 
 #ifdef DEBUG
-#ifdef MOZ_OLD_STYLE
-  nsStyleSet* CloneStyleSet(nsStyleSet* aSet);
-#endif
   ServoStyleSet* CloneStyleSet(ServoStyleSet* aSet);
   bool VerifyIncrementalReflow();
   bool mInVerifyReflow;
   void ShowEventTargetDebug();
 #endif
 
   void RecordStyleSheetChange(StyleSheet* aStyleSheet, StyleSheet::ChangeType);
 
--- a/layout/base/RestyleLogging.h
+++ b/layout/base/RestyleLogging.h
@@ -9,19 +9,16 @@
  */
 
 #ifndef mozilla_RestyleLogging_h
 #define mozilla_RestyleLogging_h
 
 #include "mozilla/AutoRestore.h"
 
 #ifdef DEBUG
-#ifdef MOZ_OLD_STYLE
-#define RESTYLE_LOGGING
-#endif
 #endif
 
 #ifdef RESTYLE_LOGGING
 #define LOG_RESTYLE_VAR2(prefix_, suffix_) prefix_##suffix_
 #define LOG_RESTYLE_VAR(prefix_, suffix_) LOG_RESTYLE_VAR2(prefix_, suffix_)
 #define LOG_RESTYLE_DEPTH LOG_RESTYLE_VAR(restyle_depth_, __LINE__)
 #define LOG_RESTYLE_IF(object_, cond_, message_, ...)                         \
   PR_BEGIN_MACRO                                                              \
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -620,181 +620,27 @@ RestyleManager::ChangeHintToString(nsCha
 /**
  * Frame construction helpers follow.
  */
 #ifdef DEBUG
 static bool gInApplyRenderingChangeToTree = false;
 #endif
 
 #ifdef DEBUG
-#ifdef MOZ_OLD_STYLE
-static void
-DumpContext(nsIFrame* aFrame, nsStyleContext* aContext)
-{
-  if (aFrame) {
-    fputs("frame: ", stdout);
-    nsAutoString name;
-    aFrame->GetFrameName(name);
-    fputs(NS_LossyConvertUTF16toASCII(name).get(), stdout);
-    fprintf(stdout, " (%p)", static_cast<void*>(aFrame));
-  }
-  if (aContext) {
-    fprintf(stdout, " style: %p ", static_cast<void*>(aContext));
-
-    nsAtom* pseudoTag = aContext->GetPseudo();
-    if (pseudoTag) {
-      nsAutoString buffer;
-      pseudoTag->ToString(buffer);
-      fputs(NS_LossyConvertUTF16toASCII(buffer).get(), stdout);
-      fputs(" ", stdout);
-    }
-    fputs("{}\n", stdout);
-  }
-}
-
-static void
-VerifySameTree(GeckoStyleContext* aContext1, GeckoStyleContext* aContext2)
-{
-  GeckoStyleContext* top1 = aContext1;
-  GeckoStyleContext* top2 = aContext2;
-  GeckoStyleContext* parent;
-  for (;;) {
-    parent = top1->GetParent();
-    if (!parent)
-      break;
-    top1 = parent;
-  }
-  for (;;) {
-    parent = top2->GetParent();
-    if (!parent)
-      break;
-    top2 = parent;
-  }
-  NS_ASSERTION(top1 == top2,
-               "Style contexts are not in the same style context tree");
-}
-
-static void
-VerifyContextParent(nsIFrame* aFrame, GeckoStyleContext* aContext,
-                    GeckoStyleContext* aParentContext)
-{
-  // get the contexts not provided
-  if (!aContext) {
-    aContext = aFrame->StyleContext()->AsGecko();
-  }
-
-  if (!aParentContext) {
-    nsIFrame* providerFrame;
-    nsStyleContext* parent = aFrame->GetParentStyleContext(&providerFrame);
-    aParentContext = parent ? parent->AsGecko() : nullptr;
-    // aParentContext could still be null
-  }
-
-  NS_ASSERTION(aContext, "Failure to get required contexts");
-  GeckoStyleContext* actualParentContext = aContext->GetParent();
-
-  if (aParentContext) {
-    if (aParentContext != actualParentContext) {
-      DumpContext(aFrame, aContext);
-      if (aContext == aParentContext) {
-        NS_ERROR("Using parent's style context");
-      } else {
-        NS_ERROR("Wrong parent style context");
-        fputs("Wrong parent style context: ", stdout);
-        DumpContext(nullptr, actualParentContext);
-        fputs("should be using: ", stdout);
-        DumpContext(nullptr, aParentContext);
-        VerifySameTree(actualParentContext, aParentContext);
-        fputs("\n", stdout);
-      }
-    }
-
-  } else {
-    if (actualParentContext) {
-      NS_ERROR("Have parent context and shouldn't");
-      DumpContext(aFrame, aContext);
-      fputs("Has parent context: ", stdout);
-      DumpContext(nullptr, actualParentContext);
-      fputs("Should be null\n\n", stdout);
-    }
-  }
-
-  GeckoStyleContext* childStyleIfVisited = aContext->GetStyleIfVisited();
-  // Either childStyleIfVisited has aContext->GetParent()->GetStyleIfVisited()
-  // as the parent or it has a different rulenode from aContext _and_ has
-  // aContext->GetParent() as the parent.
-  if (childStyleIfVisited &&
-      !((childStyleIfVisited->RuleNode() != aContext->RuleNode() &&
-         childStyleIfVisited->GetParent() == aContext->GetParent()) ||
-        childStyleIfVisited->GetParent() ==
-          aContext->GetParent()->GetStyleIfVisited())) {
-    NS_ERROR("Visited style has wrong parent");
-    DumpContext(aFrame, aContext);
-    fputs("\n", stdout);
-  }
-}
-
-static void
-VerifyStyleTree(nsIFrame* aFrame)
-{
-  GeckoStyleContext* context = aFrame->StyleContext()->AsGecko();
-  VerifyContextParent(aFrame, context, nullptr);
-
-  nsIFrame::ChildListIterator lists(aFrame);
-  for (; !lists.IsDone(); lists.Next()) {
-    for (nsIFrame* child : lists.CurrentList()) {
-      if (!(child->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
-        // only do frames that are in flow
-        if (child->IsPlaceholderFrame()) {
-          // placeholder: first recurse and verify the out of flow frame,
-          // then verify the placeholder's context
-          nsIFrame* outOfFlowFrame =
-            nsPlaceholderFrame::GetRealFrameForPlaceholder(child);
-
-          // recurse to out of flow frame, letting the parent context get resolved
-          do {
-            VerifyStyleTree(outOfFlowFrame);
-          } while ((outOfFlowFrame = outOfFlowFrame->GetNextContinuation()));
-
-          // verify placeholder using the parent frame's context as
-          // parent context
-          VerifyContextParent(child, nullptr, nullptr);
-        } else { // regular frame
-          VerifyStyleTree(child);
-        }
-      }
-    }
-  }
-
-  // do additional contexts
-  int32_t contextIndex = 0;
-  for (nsStyleContext* extraContext;
-       (extraContext = aFrame->GetAdditionalStyleContext(contextIndex));
-       ++contextIndex) {
-    VerifyContextParent(aFrame, extraContext->AsGecko(), context);
-  }
-}
-#endif
 
 void
 RestyleManager::DebugVerifyStyleTree(nsIFrame* aFrame)
 {
   if (IsServo()) {
     // XXXheycam For now, we know that we don't use the same inheritance
     // hierarchy for certain cases, so just skip these assertions until
     // we work out what we want to assert (bug 1322570).
     return;
   }
-#ifdef MOZ_OLD_STYLE
-  if (aFrame) {
-    VerifyStyleTree(aFrame);
-  }
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 #endif // DEBUG
 
 /**
  * Sync views on aFrame and all of aFrame's descendants (following placeholders),
  * if aChange has nsChangeHint_SyncFrameView.
  * Calls DoApplyRenderingChangeToTree on all aFrame's out-of-flow descendants
@@ -1900,23 +1746,17 @@ RestyleManager::GetAnimationGenerationFo
 
 void
 RestyleManager::IncrementAnimationGeneration()
 {
   // We update the animation generation at start of each call to
   // ProcessPendingRestyles so we should ignore any subsequent (redundant)
   // calls that occur while we are still processing restyles.
   if (IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    if (AsGecko()->IsProcessingRestyles()) {
-      return;
-    }
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   } else {
     if (mInStyleRefresh) {
       return;
     }
   }
   ++mAnimationGeneration;
 }
 
--- a/layout/base/RestyleManagerInlines.h
+++ b/layout/base/RestyleManagerInlines.h
@@ -2,19 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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_RestyleManagerInlines_h
 #define mozilla_RestyleManagerInlines_h
 
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoRestyleManager.h"
-#endif
 #include "mozilla/ServoRestyleManager.h"
 #include "mozilla/ServoUtils.h"
 
 namespace mozilla {
 
 MOZ_DEFINE_STYLO_METHODS(RestyleManager,
                          GeckoRestyleManager, ServoRestyleManager)
 
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -330,58 +330,28 @@ NS_NewScrollbarButtonFrame (nsIPresShell
 #ifdef NOISY_FINDFRAME
 static int32_t FFWC_totalCount=0;
 static int32_t FFWC_doLoop=0;
 static int32_t FFWC_doSibling=0;
 static int32_t FFWC_recursions=0;
 static int32_t FFWC_nextInFlows=0;
 #endif
 
-#ifdef MOZ_OLD_STYLE
-
-// Wrapper class to handle stack-construction a TreeMatchContext only if we're
-// using the Gecko style system.
-class MOZ_STACK_CLASS TreeMatchContextHolder
-{
-public:
-  explicit TreeMatchContextHolder(nsIDocument* aDocument)
-  {
-    if (!aDocument->IsStyledByServo()) {
-      mMaybeTreeMatchContext.emplace(aDocument,
-                                     TreeMatchContext::ForFrameConstruction);
-    }
-  }
-
-  bool Exists() const { return mMaybeTreeMatchContext.isSome(); }
-  operator TreeMatchContext*() { return mMaybeTreeMatchContext.ptrOr(nullptr); }
-
-  TreeMatchContext* operator ->()
-  {
-    MOZ_ASSERT(mMaybeTreeMatchContext.isSome());
-    return mMaybeTreeMatchContext.ptr();
-  }
-
-private:
-  Maybe<TreeMatchContext> mMaybeTreeMatchContext;
-};
-
-#else
 
 // Define this dummy class so there are fewer call sites to change when the old
 // style system code is compiled out.
 class TreeMatchContextHolder
 {
 public:
   explicit TreeMatchContextHolder(nsIDocument* aDocument) {}
   bool Exists() const { return false; }
   operator TreeMatchContext*() { return nullptr; }
   TreeMatchContext* operator->() { MOZ_CRASH("old style system disabled"); }
 };
 
-#endif
 
 // Returns true if aFrame is an anonymous flex/grid item.
 static inline bool
 IsAnonymousFlexOrGridItem(const nsIFrame* aFrame)
 {
   const nsAtom* pseudoType = aFrame->StyleContext()->GetPseudo();
   return pseudoType == nsCSSAnonBoxes::anonymousFlexItem ||
          pseudoType == nsCSSAnonBoxes::anonymousGridItem;
@@ -891,21 +861,17 @@ public:
                           nsContainerFrame* aFixedContainingBlock,
                           nsContainerFrame* aAbsoluteContainingBlock,
                           nsContainerFrame* aFloatContainingBlock);
 
   ~nsFrameConstructorState();
 
   bool HasAncestorFilter()
   {
-#ifdef MOZ_OLD_STYLE
-    return mTreeMatchContext && mTreeMatchContext->mAncestorFilter.HasFilter();
-#else
     return false;
-#endif
   }
 
   // Function to push the existing absolute containing block state and
   // create a new scope. Code that uses this function should get matching
   // logic in GetAbsoluteContainingBlock.
   // Also makes aNewAbsoluteContainingBlock the containing block for
   // fixed-pos elements if necessary.
   // aPositionedFrame is the frame whose style actually makes
@@ -1043,32 +1009,30 @@ protected:
 
   // Our list of all pending bindings.  When we're done, we need to call
   // AddToAttachedQueue on all of them, in order.
   LinkedList<PendingBinding> mPendingBindings;
 
   PendingBinding* mCurrentPendingBindingInsertionPoint;
 };
 
-#ifndef MOZ_OLD_STYLE
 
 namespace mozilla {
 
 class AutoDisplayContentsAncestorPusher
 {
 public:
   AutoDisplayContentsAncestorPusher(TreeMatchContext& aTreeMatchContext,
                                     nsPresContext* aPresContext,
                                     nsIContent* aParent) {}
   bool IsEmpty() const { return false; }
 };
 
 } // namespace mozilla
 
-#endif
 
 nsFrameConstructorState::nsFrameConstructorState(
   nsIPresShell* aPresShell,
   TreeMatchContext* aTreeMatchContext,
   nsContainerFrame* aFixedContainingBlock,
   nsContainerFrame* aAbsoluteContainingBlock,
   nsContainerFrame* aFloatContainingBlock,
   already_AddRefed<nsILayoutHistoryState> aHistoryState)
@@ -1977,39 +1941,17 @@ nsCSSFrameConstructor::CreateGeneratedCo
       // If animations are involved, we avoid the SetExplicitStyle optimization
       // above. We need to grab style with animations from the pseudo element
       // and replace old one.
       mPresShell->StyleSet()->AsServo()->StyleNewSubtree(container);
       pseudoStyleContext =
         styleSet->AsServo()->ResolveServoStyle(container);
     }
   } else {
-#ifdef MOZ_OLD_STYLE
-    mozilla::GeckoRestyleManager* geckoRM = RestyleManager()->AsGecko();
-    GeckoRestyleManager::ReframingStyleContexts* rsc =
-      geckoRM->GetReframingStyleContexts();
-
-    if (rsc) {
-      RefPtr<GeckoStyleContext> newContext =
-        GeckoStyleContext::TakeRef(pseudoStyleContext.forget());
-      if (auto* oldStyleContext = rsc->Get(container, aPseudoElement)) {
-        GeckoRestyleManager::TryInitiatingTransition(aState.mPresContext,
-                                                     container,
-                                                     oldStyleContext,
-                                                     &newContext);
-      } else {
-        aState.mPresContext->TransitionManager()->
-          PruneCompletedTransitions(aParentContent->AsElement(),
-                                    aPseudoElement, newContext);
-      }
-      pseudoStyleContext = newContext.forget();
-    }
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   uint32_t contentCount = pseudoStyleContext->StyleContent()->ContentCount();
   for (uint32_t contentIndex = 0; contentIndex < contentCount; contentIndex++) {
     nsCOMPtr<nsIContent> content =
       CreateGeneratedContent(aState, aParentContent, pseudoStyleContext,
                              contentIndex);
     if (content) {
@@ -5284,39 +5226,17 @@ nsCSSFrameConstructor::ResolveStyleConte
                  "comments and processing instructions");
     result = styleSet->ResolveStyleForText(aContent, aParentStyleContext);
   }
 
   // ServoRestyleManager does not handle transitions yet, and when it does
   // it probably won't need to track reframed style contexts to start
   // transitions correctly.
   if (RestyleManager()->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    mozilla::GeckoRestyleManager* geckoRM = RestyleManager()->AsGecko();
-    GeckoRestyleManager::ReframingStyleContexts* rsc =
-      geckoRM->GetReframingStyleContexts();
-    if (rsc) {
-      GeckoStyleContext* oldStyleContext =
-        rsc->Get(aContent, CSSPseudoElementType::NotPseudo);
-      nsPresContext* presContext = mPresShell->GetPresContext();
-      if (oldStyleContext) {
-        RefPtr<GeckoStyleContext> newContext =
-          GeckoStyleContext::TakeRef(result.forget());
-        GeckoRestyleManager::TryInitiatingTransition(presContext, aContent,
-                                                     oldStyleContext, &newContext);
-        result = newContext.forget();
-      } else if (aContent->IsElement()) {
-        presContext->TransitionManager()->
-          PruneCompletedTransitions(aContent->AsElement(),
-            CSSPseudoElementType::NotPseudo, result->AsGecko());
-      }
-    }
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   return result.forget();
 }
 
 // MathML Mod - RBS
 void
 nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState,
@@ -5989,23 +5909,17 @@ nsCSSFrameConstructor::AddFrameConstruct
       if (resolveStyle) {
         // Need to take a different path (Servo directly grabs the style from
         // the element, Gecko needs to actually re-resolve it using the parent
         // style context).
         if (styleContext->IsServo()) {
           styleContext =
             mPresShell->StyleSet()->AsServo()->ResolveServoStyle(aContent->AsElement());
         } else {
-#ifdef MOZ_OLD_STYLE
-          styleContext =
-            ResolveStyleContext(styleContext->AsGecko()->GetParent(),
-                                aContent, &aState);
-#else
           MOZ_CRASH("old style system disabled");
-#endif
         }
       }
 
       display = styleContext->StyleDisplay();
       aStyleContext = styleContext;
       aTag = mDocument->BindingManager()->ResolveTag(aContent, &aNameSpaceID);
     }
   }
@@ -7282,130 +7196,24 @@ nsCSSFrameConstructor::MaybeConstructLaz
     }
   }
 
   // Walk up the tree setting the NODE_DESCENDANTS_NEED_FRAMES bit as we go.
   // We need different handling for servo given the scoped restyle roots.
   CheckBitsForLazyFrameConstruction(parent);
 
   if (RestyleManager()->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    mozilla::GeckoRestyleManager* geckoRM = RestyleManager()->AsGecko();
-    while (parent && !parent->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
-      parent->SetFlags(NODE_DESCENDANTS_NEED_FRAMES);
-      parent = parent->GetFlattenedTreeParent();
-    }
-    geckoRM->PostRestyleEventForLazyConstruction();
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   } else {
     parent->AsElement()->NoteDescendantsNeedFramesForServo();
   }
 
   return true;
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-nsCSSFrameConstructor::CreateNeededFrames(
-    nsIContent* aContent,
-    TreeMatchContext& aTreeMatchContext)
-{
-  MOZ_ASSERT(!aContent->IsStyledByServo());
-  NS_ASSERTION(!aContent->HasFlag(NODE_NEEDS_FRAME),
-    "shouldn't get here with a content node that has needs frame bit set");
-  NS_ASSERTION(aContent->HasFlag(NODE_DESCENDANTS_NEED_FRAMES),
-    "should only get here with a content node that has descendants needing frames");
-  MOZ_ASSERT(aTreeMatchContext.mAncestorFilter.HasFilter(),
-             "The whole point of having the tree match context is optimizing "
-             "the ancestor filter usage!");
-
-  aContent->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES);
-
-  // We could either descend first (on nodes that don't have NODE_NEEDS_FRAME
-  // set) or issue content notifications for our kids first. In absence of
-  // anything definitive either way we'll go with the latter.
-
-  // It might be better to use GetChildArray and scan it completely first and
-  // then issue all notifications. (We have to scan it completely first because
-  // constructing frames can set attributes, which can change the storage of
-  // child lists).
-
-  // Scan the children of aContent to see what operations (if any) we need to
-  // perform.
-  bool inRun = false;
-  nsIContent* firstChildInRun = nullptr;
-  for (nsIContent* child = aContent->GetFirstChild();
-       child; child = child->GetNextSibling()) {
-    if (child->HasFlag(NODE_NEEDS_FRAME)) {
-      NS_ASSERTION(!child->GetPrimaryFrame() ||
-                   child->GetPrimaryFrame()->GetContent() != child,
-                   //XXX the child->GetPrimaryFrame()->GetContent() != child
-                   // check is needed due to bug 135040. Remove it once that's
-                   // fixed.
-                   "NEEDS_FRAME set on a node that already has a frame?");
-      if (!inRun) {
-        inRun = true;
-        firstChildInRun = child;
-      }
-    } else {
-      if (inRun) {
-        inRun = false;
-        // generate a ContentRangeInserted for [startOfRun,i)
-        ContentRangeInserted(aContent, firstChildInRun, child, nullptr,
-                             InsertionKind::Sync,
-                             &aTreeMatchContext);
-      }
-    }
-  }
-
-  if (inRun) {
-    ContentAppended(aContent, firstChildInRun,
-                    InsertionKind::Sync,
-                    &aTreeMatchContext);
-  }
-
-  // Now descend.
-  FlattenedChildIterator iter(aContent);
-  for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
-    if (child->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
-      TreeMatchContext::AutoAncestorPusher insertionPointPusher(
-          &aTreeMatchContext);
-
-      // Handle stuff like xbl:children.
-      if (child->GetParent() != aContent && child->GetParent()->IsElement()) {
-        insertionPointPusher.PushAncestor(child->GetParent()->AsElement());
-      }
-
-      TreeMatchContext::AutoAncestorPusher pusher(&aTreeMatchContext);
-      pusher.PushAncestor(child);
-
-      CreateNeededFrames(child, aTreeMatchContext);
-    }
-  }
-}
-
-void
-nsCSSFrameConstructor::CreateNeededFrames()
-{
-  NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
-               "Someone forgot a script blocker");
-
-  Element* rootElement = mDocument->GetRootElement();
-  NS_ASSERTION(!rootElement || !rootElement->HasFlag(NODE_NEEDS_FRAME),
-    "root element should not have frame created lazily");
-  if (rootElement && rootElement->HasFlag(NODE_DESCENDANTS_NEED_FRAMES)) {
-    TreeMatchContext treeMatchContext(
-        mDocument, TreeMatchContext::ForFrameConstruction);
-    treeMatchContext.InitAncestors(rootElement);
-    CreateNeededFrames(rootElement, treeMatchContext);
-  }
-}
-#endif
 
 void
 nsCSSFrameConstructor::IssueSingleInsertNofications(nsIContent* aContainer,
                                                     nsIContent* aStartChild,
                                                     nsIContent* aEndChild)
 {
   for (nsIContent* child = aStartChild;
        child != aEndChild;
@@ -9387,69 +9195,16 @@ nsCSSFrameConstructor::CaptureStateForFr
       GetRootFrame();
   }
   for ( ; frame;
         frame = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(frame)) {
     CaptureFrameState(frame, aHistoryState);
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-static bool
-DefinitelyEqualURIsAndPrincipal(mozilla::css::URLValue* aURI1,
-                                mozilla::css::URLValue* aURI2)
-{
-  return aURI1 == aURI2 ||
-         (aURI1 && aURI2 && aURI1->DefinitelyEqualURIsAndPrincipal(*aURI2));
-}
-
-nsStyleContext*
-nsCSSFrameConstructor::MaybeRecreateFramesForElement(Element* aElement)
-{
-  RefPtr<nsStyleContext> oldContext = GetDisplayNoneStyleFor(aElement);
-  StyleDisplay oldDisplay = StyleDisplay::None;
-  if (!oldContext) {
-    oldContext = GetDisplayContentsStyleFor(aElement);
-    if (!oldContext) {
-      return nullptr;
-    }
-    oldDisplay = StyleDisplay::Contents;
-  }
-
-  // The parent has a frame, so try resolving a new context.
-  RefPtr<nsStyleContext> newContext = mPresShell->StyleSet()->
-    ResolveStyleFor(aElement, oldContext->AsGecko()->GetParent(),
-                    LazyComputeBehavior::Assert);
-
-  if (oldDisplay == StyleDisplay::None) {
-    ChangeRegisteredDisplayNoneStyleFor(aElement, newContext);
-  } else {
-    ChangeRegisteredDisplayContentsStyleFor(aElement, newContext);
-  }
-
-  const nsStyleDisplay* disp = newContext->StyleDisplay();
-  if (oldDisplay == disp->mDisplay) {
-    // We can skip trying to recreate frames here, but only if our style
-    // context does not have a binding URI that differs from our old one.
-    // Otherwise, we should try to recreate, because we may want to apply the
-    // new binding
-    if (!disp->mBinding) {
-      return newContext;
-    }
-    const nsStyleDisplay* oldDisp = oldContext->PeekStyleDisplay();
-    if (oldDisp &&
-        DefinitelyEqualURIsAndPrincipal(disp->mBinding, oldDisp->mBinding)) {
-      return newContext;
-    }
-  }
-
-  RecreateFramesForContent(aElement, InsertionKind::Sync);
-  return nullptr;
-}
-#endif
 
 static bool
 IsWhitespaceFrame(nsIFrame* aFrame)
 {
   MOZ_ASSERT(aFrame, "invalid argument");
   return aFrame->IsTextFrame() && aFrame->GetContent()->TextIsOnlyWhitespace();
 }
 
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -95,30 +95,19 @@ public:
 
   mozilla::RestyleManager* RestyleManager() const
     { return mPresShell->GetPresContext()->RestyleManager(); }
 
   nsIFrame* ConstructRootFrame();
 
   void ReconstructDocElementHierarchy(InsertionKind);
 
-#ifdef MOZ_OLD_STYLE
-  // Create frames for content nodes that are marked as needing frames. This
-  // should be called before ProcessPendingRestyles.
-  // Note: It's the caller's responsibility to make sure to wrap a
-  // CreateNeededFrames call in a view update batch and a script blocker.
-  void CreateNeededFrames();
-#endif
 
 private:
 
-#ifdef MOZ_OLD_STYLE
-  void CreateNeededFrames(nsIContent* aContent,
-                          TreeMatchContext& aTreeMatchContext);
-#endif
 
   enum Operation {
     CONTENTAPPEND,
     CONTENTINSERT
   };
 
   // aChild is the child being inserted for inserts, and the first
   // child being appended for appends.
@@ -1860,26 +1849,16 @@ private:
                         nsContainerFrame*        aScrolledFrame,
                         nsIContent*              aContent,
                         nsContainerFrame*        aParentFrame,
                         nsStyleContext*          aStyleContext,
                         bool                     aBuildCombobox,
                         PendingBinding*          aPendingBinding,
                         nsFrameItems&            aFrameItems);
 
-#ifdef MOZ_OLD_STYLE
-  /**
-   * ReResolve style for aElement then recreate frames if required.
-   * Do nothing for other types of style changes, except for undisplayed nodes
-   * (display:none/contents) which will have their style context updated in the
-   * frame manager undisplayed maps.
-   * @return null if frames were recreated, the new style context otherwise
-   */
-  nsStyleContext* MaybeRecreateFramesForElement(Element* aElement);
-#endif
 
   /**
    * Recreate frames for aContent.
    * @param aContent the content to recreate frames for
    * @param aFlags normally you want to pass REMOVE_FOR_RECONSTRUCTION here
    */
   void RecreateFramesForContent(nsIContent*   aContent,
                                 InsertionKind aInsertionKind);
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2316,21 +2316,17 @@ nsDocumentViewer::CreateStyleSet(nsIDocu
 
   // this should eventually get expanded to allow for creating
   // different sets for different media
 
   StyleBackendType backendType = aDocument->GetStyleBackendType();
 
   StyleSetHandle styleSet;
   if (backendType == StyleBackendType::Gecko) {
-#ifdef MOZ_OLD_STYLE
-    styleSet = new nsStyleSet();
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   } else {
     styleSet = new ServoStyleSet();
   }
 
   styleSet->BeginUpdate();
 
   // The document will fill in the document sheets when we create the presshell
 
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -191,19 +191,17 @@ typedef nsStyleTransformMatrix::Transfor
 /* static */ bool nsLayoutUtils::sFontSizeInflationDisabledInMasterProcess;
 /* static */ uint32_t nsLayoutUtils::sSystemFontScale;
 /* static */ uint32_t nsLayoutUtils::sZoomMaxPercent;
 /* static */ uint32_t nsLayoutUtils::sZoomMinPercent;
 /* static */ bool nsLayoutUtils::sInvalidationDebuggingIsEnabled;
 /* static */ bool nsLayoutUtils::sInterruptibleReflowEnabled;
 /* static */ bool nsLayoutUtils::sSVGTransformBoxEnabled;
 /* static */ bool nsLayoutUtils::sTextCombineUprightDigitsEnabled;
-#ifdef MOZ_STYLO
 /* static */ bool nsLayoutUtils::sStyloEnabled;
-#endif
 /* static */ uint32_t nsLayoutUtils::sIdlePeriodDeadlineLimit;
 /* static */ uint32_t nsLayoutUtils::sQuiescentFramesBeforeIdlePeriod;
 
 static ViewID sScrollIdCounter = FrameMetrics::START_SCROLL_ID;
 
 typedef nsDataHashtable<nsUint64HashKey, nsIContent*> ContentMap;
 static ContentMap* sContentMap = nullptr;
 static ContentMap& GetContentMap() {
@@ -8277,30 +8275,17 @@ nsLayoutUtils::Initialize()
   Preferences::AddBoolVarCache(&sInvalidationDebuggingIsEnabled,
                                "nglayout.debug.invalidation");
   Preferences::AddBoolVarCache(&sInterruptibleReflowEnabled,
                                "layout.interruptible-reflow.enabled");
   Preferences::AddBoolVarCache(&sSVGTransformBoxEnabled,
                                "svg.transform-box.enabled");
   Preferences::AddBoolVarCache(&sTextCombineUprightDigitsEnabled,
                                "layout.css.text-combine-upright-digits.enabled");
-#ifdef MOZ_STYLO
-#ifdef MOZ_OLD_STYLE
-  if (PR_GetEnv("STYLO_FORCE_ENABLED")) {
-    sStyloEnabled = true;
-  } else if (PR_GetEnv("STYLO_FORCE_DISABLED")) {
-    sStyloEnabled = false;
-  } else {
-    Preferences::AddBoolVarCache(&sStyloEnabled,
-                                 "layout.css.servo.enabled");
-  }
-#else
   sStyloEnabled = true;
-#endif
-#endif
 
   Preferences::AddUintVarCache(&sIdlePeriodDeadlineLimit,
                                "layout.idle_period.time_limit",
                                DEFAULT_IDLE_PERIOD_TIME_LIMIT);
   Preferences::AddUintVarCache(&sQuiescentFramesBeforeIdlePeriod,
                                "layout.idle_period.required_quiescent_frames",
                                DEFAULT_QUIESCENT_FRAMES);
 
@@ -8323,53 +8308,29 @@ nsLayoutUtils::Shutdown()
     Preferences::UnregisterCallback(callback.func, callback.name);
   }
   nsComputedDOMStyle::UnregisterPrefChangeCallbacks();
 
   // so the cached initial quotes array doesn't appear to be a leak
   nsStyleList::Shutdown();
 }
 
-#ifdef MOZ_STYLO
 /* static */
 bool
 nsLayoutUtils::ShouldUseStylo(nsIPrincipal* aPrincipal)
 {
-#ifdef MOZ_OLD_STYLE
-  // Disable stylo for system principal because XUL hasn't been fully
-  // supported. Other principal aren't able to use XUL by default, and
-  // the back door to enable XUL is mostly just for testing, which means
-  // they don't matter, and we shouldn't respect them at the same time.
-  if (!StyloChromeEnabled() &&
-      nsContentUtils::IsSystemPrincipal(aPrincipal)) {
-    return false;
-  }
-#endif
   return true;
 }
 
 /* static */
 bool
 nsLayoutUtils::StyloChromeEnabled()
 {
-#ifdef MOZ_OLD_STYLE
-  static bool sInitialized = false;
-  static bool sEnabled = false;
-  if (!sInitialized) {
-    // We intentionally don't allow dynamic toggling of this pref
-    // because it is rather risky to mix style backend in XUL.
-    sEnabled = Preferences::GetBool("layout.css.servo.chrome.enabled");
-    sInitialized = true;
-  }
-  return sEnabled;
-#else
   return true;
-#endif
-}
-#endif
+}
 
 /* static */
 void
 nsLayoutUtils::RegisterImageRequest(nsPresContext* aPresContext,
                                     imgIRequest* aRequest,
                                     bool* aRequestRegistered)
 {
   if (!aPresContext) {
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -19,19 +19,16 @@
 #include "nsThreadUtils.h"
 #include "nsIPrincipal.h"
 #include "FrameMetrics.h"
 #include "nsIWidget.h"
 #include "nsCSSPropertyID.h"
 #include "nsStyleCoord.h"
 #include "nsStyleConsts.h"
 #include "nsGkAtoms.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleNode.h"
-#endif
 #include "imgIContainer.h"
 #include "mozilla/gfx/2D.h"
 #include "Units.h"
 #include "mozilla/ToString.h"
 #include "mozilla/ReflowOutput.h"
 #include "ImageContainer.h"
 #include "gfx2DGlue.h"
 #include "nsStyleConsts.h"
@@ -2523,51 +2520,41 @@ public:
   static bool TextCombineUprightDigitsEnabled() {
     return sTextCombineUprightDigitsEnabled;
   }
 
   // Stylo (the Servo backend for Gecko's style system) is generally enabled
   // or disabled at compile-time. However, we provide the additional capability
   // to disable it dynamically in stylo-enabled builds via a pref.
   static bool StyloEnabled() {
-#if defined(MOZ_STYLO) && defined(MOZ_OLD_STYLE)
-    return sStyloEnabled && StyloSupportedInCurrentProcess();
-#elif defined(MOZ_STYLO)
     return true;
-#else
-    return false;
-#endif
   }
 
   // Whether Stylo should be allowed to be enabled in this process.
   static bool StyloSupportedInCurrentProcess() {
-#ifdef MOZ_STYLO
     if (XRE_IsContentProcess()) {
       return true;
     }
     if (XRE_IsParentProcess()) {
       // If Stylo is enabled for chrome document, we use it in all
       // parent processes, regardless of whether it's e10s parent.
       if (StyloChromeEnabled()) {
         return true;
       }
       // Otherwise we only use stylo on non-e10s parent.
       return !XRE_IsE10sParentProcess();
     }
-#endif
     // Stylo is not enabled for any other process.
     MOZ_DIAGNOSTIC_ASSERT(false, "We should not be creating any document "
                           "in processes other than content and parent");
     return false;
   }
 
-#ifdef MOZ_STYLO
   // Whether Stylo should be used on chrome documents.
   static bool StyloChromeEnabled();
-#endif
 
   static uint32_t IdlePeriodDeadlineLimit() {
     return sIdlePeriodDeadlineLimit;
   }
 
   static uint32_t QuiescentFramesBeforeIdlePeriod() {
     return sQuiescentFramesBeforeIdlePeriod;
   }
@@ -2587,26 +2574,20 @@ public:
    */
   static bool InvalidationDebuggingIsEnabled() {
     return sInvalidationDebuggingIsEnabled || getenv("MOZ_DUMP_INVALIDATION") != 0;
   }
 
   static void Initialize();
   static void Shutdown();
 
-#ifdef MOZ_STYLO
   /**
    * Return whether stylo should be used for a given document principal.
    */
   static bool ShouldUseStylo(nsIPrincipal* aPrincipal);
-#else
-  static bool ShouldUseStylo(nsIPrincipal* aPrincipal) {
-    return false;
-  }
-#endif
 
   /**
    * Register an imgIRequest object with a refresh driver.
    *
    * @param aPresContext The nsPresContext whose refresh driver we want to
    *        register with.
    * @param aRequest A pointer to the imgIRequest object which the client wants
    *        to register with the refresh driver.
@@ -3115,19 +3096,17 @@ private:
   static bool sFontSizeInflationDisabledInMasterProcess;
   static uint32_t sSystemFontScale;
   static uint32_t sZoomMaxPercent;
   static uint32_t sZoomMinPercent;
   static bool sInvalidationDebuggingIsEnabled;
   static bool sInterruptibleReflowEnabled;
   static bool sSVGTransformBoxEnabled;
   static bool sTextCombineUprightDigitsEnabled;
-#ifdef MOZ_STYLO
   static bool sStyloEnabled;
-#endif
   static uint32_t sIdlePeriodDeadlineLimit;
   static uint32_t sQuiescentFramesBeforeIdlePeriod;
 
   /**
    * Helper function for LogTestDataForPaint().
    */
   static void DoLogTestDataForPaint(mozilla::layers::LayerManager* aManager,
                                     ViewID aScrollId,
--- a/layout/base/nsPresArena.cpp
+++ b/layout/base/nsPresArena.cpp
@@ -7,19 +7,16 @@
 
 /* arena allocation for the frame tree and closely-related objects */
 
 #include "nsPresArena.h"
 
 #include "mozilla/Poison.h"
 #include "nsDebug.h"
 #include "nsPrintfCString.h"
-#ifdef MOZ_OLD_STYLE
-#include "GeckoStyleContext.h"
-#endif
 #include "FrameLayerBuilder.h"
 #include "mozilla/ArrayUtils.h"
 #include "nsStyleContext.h"
 #include "nsStyleContextInlines.h"
 #include "nsWindowSizes.h"
 
 #include <inttypes.h>
 
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -33,30 +33,21 @@
 #include "nsLanguageAtomService.h"
 #include "mozilla/LookAndFeel.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsHTMLDocument.h"
 #include "nsIWeakReferenceUtils.h"
 #include "nsThreadUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsViewManager.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoRestyleManager.h"
-#endif
 #include "mozilla/RestyleManager.h"
 #include "mozilla/RestyleManagerInlines.h"
 #include "SurfaceCacheUtils.h"
 #include "nsMediaFeatures.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleNode.h"
-#endif
 #include "gfxPlatform.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRules.h"
-#endif
 #include "nsFontFaceLoader.h"
 #include "mozilla/AnimationEventDispatcher.h"
 #include "mozilla/EffectCompositor.h"
 #include "mozilla/EventListenerManager.h"
 #include "prenv.h"
 #include "nsPluginFrame.h"
 #include "nsTransitionManager.h"
 #include "nsAnimationManager.h"
@@ -121,75 +112,35 @@ constexpr char kUseStandinsForNativeColo
  * of local invalidations of them and their descendant layers.
  * Pass a callback to ComputeDifferences to have these called.
  */
 class ContainerLayerPresContext : public LayerUserData {
 public:
   nsPresContext* mPresContext;
 };
 
-#ifdef MOZ_OLD_STYLE
-
-namespace {
-
-class CharSetChangingRunnable : public Runnable
-{
-public:
-  CharSetChangingRunnable(nsPresContext* aPresContext,
-                          NotNull<const Encoding*> aCharSet)
-    : Runnable("CharSetChangingRunnable"),
-      mPresContext(aPresContext),
-      mCharSet(aCharSet)
-  {
-  }
-
-  NS_IMETHOD Run() override
-  {
-    mPresContext->DoChangeCharSet(mCharSet);
-    return NS_OK;
-  }
-
-private:
-  RefPtr<nsPresContext> mPresContext;
-  NotNull<const Encoding*> mCharSet;
-};
-
-} // namespace
-
-#endif
 
 nscolor
 nsPresContext::MakeColorPref(const nsString& aColor)
 {
   bool ok;
   nscolor result;
 
   ServoStyleSet* servoStyleSet = mShell && mShell->StyleSet()
     ? mShell->StyleSet()->GetAsServo()
     : nullptr;
 
   bool useServoParser =
-#ifdef MOZ_OLD_STYLE
-    servoStyleSet;
-#else
     true;
-#endif
 
   if (useServoParser) {
     ok = ServoCSSParser::ComputeColor(servoStyleSet, NS_RGB(0, 0, 0), aColor,
                                       &result);
   } else {
-#ifdef MOZ_OLD_STYLE
-    nsCSSParser parser;
-    nsCSSValue value;
-    ok = parser.ParseColorString(aColor, nullptr, 0, value) &&
-         nsRuleNode::ComputeColor(value, this, nullptr, result);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   if (!ok) {
     // Any better choices?
     result = NS_RGB(0, 0, 0);
   }
 
   return result;
@@ -1025,21 +976,17 @@ void
 nsPresContext::AttachShell(nsIPresShell* aShell, StyleBackendType aBackendType)
 {
   MOZ_ASSERT(!mShell);
   mShell = aShell;
 
   if (aBackendType == StyleBackendType::Servo) {
     mRestyleManager = new ServoRestyleManager(this);
   } else {
-#ifdef MOZ_OLD_STYLE
-    mRestyleManager = new GeckoRestyleManager(this);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   // Since CounterStyleManager is also the name of a method of
   // nsPresContext, it is necessary to prefix the class with the mozilla
   // namespace here.
   mCounterStyleManager = new mozilla::CounterStyleManager(this);
 
   nsIDocument *doc = mShell->GetDocument();
@@ -1164,24 +1111,16 @@ nsPresContext::UpdateCharSet(NotNull<con
     default:
       SetVisualMode(IsVisualCharset(aCharSet));
   }
 }
 
 void
 nsPresContext::DispatchCharSetChange(NotNull<const Encoding*> aEncoding)
 {
-#ifdef MOZ_OLD_STYLE
-  if (!Document()->IsStyledByServo()) {
-    RefPtr<CharSetChangingRunnable> runnable =
-      new CharSetChangingRunnable(this, aEncoding);
-    Document()->Dispatch(TaskCategory::Other, runnable.forget());
-    return;
-  }
-#endif
   // In Servo RebuildAllStyleData is async, so no need to do the runnable dance.
   DoChangeCharSet(aEncoding);
 }
 
 nsPresContext*
 nsPresContext::GetParentPresContext()
 {
   nsIPresShell* shell = GetPresShell();
@@ -2071,21 +2010,17 @@ nsPresContext::RebuildAllStyleData(nsCha
     return;
   }
 
   // FIXME(emilio): Why is it safe to reset mUsesRootEMUnits / mUsesEXChUnits
   // here if there's no restyle hint? That looks pretty bogus.
   mUsesRootEMUnits = false;
   mUsesExChUnits = false;
   if (mShell->StyleSet()->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    mShell->StyleSet()->AsGecko()->SetUsesViewportUnits(false);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
 
   // TODO(emilio): It's unclear to me why would these three calls below be
   // needed. In particular, RebuildAllStyleData doesn't rebuild rules or
   // specified style information and such (note the comment in
   // ServoRestyleManager::RebuildAllStyleData re. the funny semantics), so I
   // don't know why should we rebuild the user font set / counter styles /
   // etc...
@@ -2271,25 +2206,17 @@ nsPresContext::UpdateIsChrome()
               nsIDocShellTreeItem::typeChrome == mContainer->ItemType();
 }
 
 bool
 nsPresContext::HasAuthorSpecifiedRules(const nsIFrame* aFrame,
                                        uint32_t aRuleTypeMask) const
 {
   if (aFrame->StyleContext()->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    auto* geckoStyleContext = aFrame->StyleContext()->AsGecko();
-    return
-      nsRuleNode::HasAuthorSpecifiedRules(geckoStyleContext,
-                                          aRuleTypeMask,
-                                          UseDocumentColors());
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
   Element* elem = aFrame->GetContent()->AsElement();
 
   // We need to handle non-generated content pseudos too, so we use
   // the parent of generated content pseudo to be consistent.
   if (elem->GetPseudoElementType() != CSSPseudoElementType::NotPseudo) {
     MOZ_ASSERT(elem->GetParent(), "Pseudo element has no parent element?");
     elem = elem->GetParent()->AsElement();
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -45,19 +45,16 @@
 #include "mozilla/PendingAnimationTracker.h"
 #include "mozilla/Preferences.h"
 #include "nsViewManager.h"
 #include "GeckoProfiler.h"
 #include "nsNPAPIPluginInstance.h"
 #include "mozilla/dom/Performance.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/WindowBinding.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoRestyleManager.h"
-#endif
 #include "mozilla/RestyleManager.h"
 #include "mozilla/RestyleManagerInlines.h"
 #include "Layers.h"
 #include "imgIContainer.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsDocShell.h"
 #include "nsISimpleEnumerator.h"
 #include "nsJSEnvironment.h"
--- a/layout/base/nsStyleSheetService.cpp
+++ b/layout/base/nsStyleSheetService.cpp
@@ -2,19 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 /* implementation of interface for managing user and user-agent style sheets */
 
 #include "nsStyleSheetService.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/CSSStyleSheet.h"
-#endif
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PreloadedStyleSheet.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/Unused.h"
 #include "mozilla/css/Loader.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/Promise.h"
@@ -172,19 +169,17 @@ nsStyleSheetService::LoadAndRegisterShee
   }
 
   rv = LoadAndRegisterSheetInternal(aSheetURI, aSheetType);
   if (NS_SUCCEEDED(rv)) {
     // Success means that at least the Gecko sheet was loaded. It's possible
     // that a Servo sheet was also loaded. In both cases, the new sheets are
     // the last sheets in m{Gecko,Servo}Sheets[aSheetType]
     bool servoSheetWasAdded = false;
-#ifdef MOZ_STYLO
     servoSheetWasAdded = nsLayoutUtils::StyloSupportedInCurrentProcess();
-#endif
 
     // Hold on to a copy of the registered PresShells.
     nsTArray<nsCOMPtr<nsIPresShell>> toNotify(mPresShells);
     for (nsIPresShell* presShell : toNotify) {
       if (presShell->StyleSet()) {
         StyleBackendType backendType = presShell->StyleSet()->BackendType();
         if (backendType == StyleBackendType::Gecko || servoSheetWasAdded) {
           StyleSheet* sheet = Sheets(backendType)[aSheetType].LastElement();
@@ -245,56 +240,41 @@ nsStyleSheetService::LoadAndRegisterShee
       break;
 
     default:
       NS_WARNING("invalid sheet type argument");
       return NS_ERROR_INVALID_ARG;
   }
 
 
-#ifdef MOZ_OLD_STYLE
-  {
-    RefPtr<StyleSheet> geckoSheet;
-    nsresult rv = LoadSheet(aSheetURI, parsingMode, StyleBackendType::Gecko, &geckoSheet);
-    NS_ENSURE_SUCCESS(rv, rv);
-    MOZ_ASSERT(geckoSheet);
-    mGeckoSheets[aSheetType].AppendElement(geckoSheet);
-  }
-#endif
 
-#ifdef MOZ_STYLO
   if (nsLayoutUtils::StyloSupportedInCurrentProcess()) {
     RefPtr<StyleSheet> servoSheet;
     nsresult rv = LoadSheet(aSheetURI, parsingMode, StyleBackendType::Servo, &servoSheet);
     NS_ENSURE_SUCCESS(rv, rv);
     MOZ_ASSERT(servoSheet);
     mServoSheets[aSheetType].AppendElement(servoSheet);
   }
-#endif
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsStyleSheetService::SheetRegistered(nsIURI *sheetURI,
                                      uint32_t aSheetType, bool *_retval)
 {
   NS_ENSURE_ARG(aSheetType == AGENT_SHEET ||
                 aSheetType == USER_SHEET ||
                 aSheetType == AUTHOR_SHEET);
   NS_ENSURE_ARG_POINTER(sheetURI);
   NS_PRECONDITION(_retval, "Null out param");
 
   // Check to see if we have the sheet.
   StyleBackendType backendType =
-#ifdef MOZ_OLD_STYLE
-    StyleBackendType::Gecko;
-#else
     StyleBackendType::Servo;
-#endif
   *_retval = (FindSheetByURI(backendType, aSheetType, sheetURI) >= 0);
 
   return NS_OK;
 }
 
 static nsresult
 GetParsingMode(uint32_t aSheetType, css::SheetParsingMode* aParsingMode)
 {
@@ -380,45 +360,32 @@ nsStyleSheetService::UnregisterSheet(nsI
   NS_ENSURE_ARG(aSheetType == AGENT_SHEET ||
                 aSheetType == USER_SHEET ||
                 aSheetType == AUTHOR_SHEET);
   NS_ENSURE_ARG_POINTER(aSheetURI);
 
   // We have to search for Gecko and Servo sheets separately.
   int32_t foundIndex;
 
-#ifdef MOZ_OLD_STYLE
-  // Gecko first, which should always be present, if the old style system
-  // is enabled.
-  foundIndex = FindSheetByURI(StyleBackendType::Gecko, aSheetType, aSheetURI);
-  NS_ENSURE_TRUE(foundIndex >= 0, NS_ERROR_INVALID_ARG);
-
-  RefPtr<StyleSheet> geckoSheet = mGeckoSheets[aSheetType][foundIndex];
-  mGeckoSheets[aSheetType].RemoveElementAt(foundIndex);
-#endif
 
   // Now search for Servo, which may or may not be present.
   RefPtr<StyleSheet> servoSheet;
   foundIndex = FindSheetByURI(StyleBackendType::Servo,
                               aSheetType, aSheetURI);
   if (foundIndex >= 0) {
     servoSheet = mServoSheets[aSheetType][foundIndex];
     mServoSheets[aSheetType].RemoveElementAt(foundIndex);
   }
 
   // Hold on to a copy of the registered PresShells.
   nsTArray<nsCOMPtr<nsIPresShell>> toNotify(mPresShells);
   for (nsIPresShell* presShell : toNotify) {
     if (presShell->StyleSet()) {
       StyleSheet* sheet =
-#ifdef MOZ_OLD_STYLE
-        presShell->StyleSet()->IsGecko() ? geckoSheet : servoSheet;
-#else
         servoSheet;
-#endif
       if (sheet) {
         presShell->NotifyStyleSheetServiceSheetRemoved(sheet, aSheetType);
       }
     }
   }
 
   if (XRE_IsParentProcess()) {
     nsTArray<dom::ContentParent*> children;
@@ -468,19 +435,16 @@ nsStyleSheetService::CollectReports(nsIH
   return NS_OK;
 }
 
 size_t
 nsStyleSheetService::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
 {
   size_t n = aMallocSizeOf(this);
   for (auto* sheetArrays : {
-#ifdef MOZ_OLD_STYLE
-      &mGeckoSheets,
-#endif
       &mServoSheets,
     }) {
     for (auto& sheetArray : *sheetArrays) {
       n += sheetArray.ShallowSizeOfExcludingThis(aMallocSizeOf);
       for (StyleSheet* sheet : sheetArray) {
         if (sheet) {
           n += sheet->SizeOfIncludingThis(aMallocSizeOf);
         }
--- a/layout/base/nsStyleSheetService.h
+++ b/layout/base/nsStyleSheetService.h
@@ -80,29 +80,20 @@ private:
 
   // Like LoadAndRegisterSheet, but doesn't notify.  If successful, the
   // new sheet will be the last sheet in mSheets[aSheetType].
   nsresult LoadAndRegisterSheetInternal(nsIURI *aSheetURI,
                                         uint32_t aSheetType);
 
   mozilla::Array<SheetArray, 3>& Sheets(mozilla::StyleBackendType aType)
   {
-#ifdef MOZ_OLD_STYLE
-    if (aType == mozilla::StyleBackendType::Gecko) {
-      return mGeckoSheets;
-    }
-#else
     MOZ_ASSERT(aType == mozilla::StyleBackendType::Servo);
-#endif
     return mServoSheets;
   }
 
-#ifdef MOZ_OLD_STYLE
-  mozilla::Array<SheetArray, 3> mGeckoSheets;
-#endif
   mozilla::Array<SheetArray, 3> mServoSheets;
 
   // Registered PresShells that will be notified when sheets are added and
   // removed from the style sheet service.
   nsTArray<nsCOMPtr<nsIPresShell>> mPresShells;
 };
 
 #endif
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -35,19 +35,16 @@
 #include "nsIObserverService.h"
 #include "nsIScriptNameSpaceManager.h"
 #include "nsIScriptError.h"
 #include "nsISelection.h"
 #include "nsCaret.h"
 #include "nsPlainTextSerializer.h"
 #include "nsXMLContentSerializer.h"
 #include "nsXHTMLContentSerializer.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleNode.h"
-#endif
 #include "nsContentAreaDragDrop.h"
 #include "nsBox.h"
 #include "nsIFrameTraversal.h"
 #include "nsLayoutCID.h"
 #include "nsStyleSheetService.h"
 #include "nsFocusManager.h"
 #include "ThirdPartyUtil.h"
 #include "nsStructuredCloneContainer.h"
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -28,28 +28,22 @@
 #include "mozilla/dom/Attr.h"
 #include "nsDOMClassInfo.h"
 #include "mozilla/EventListenerManager.h"
 #include "nsFrame.h"
 #include "nsGlobalWindow.h"
 #include "nsGkAtoms.h"
 #include "nsImageFrame.h"
 #include "nsLayoutStylesheetCache.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/RuleProcessorCache.h"
-#endif
 #include "nsRange.h"
 #include "nsRegion.h"
 #include "nsRepeatService.h"
 #include "nsFloatManager.h"
 #include "nsSprocketLayout.h"
 #include "nsStackLayout.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "nsTextControlFrame.h"
 #include "nsXBLService.h"
 #include "txMozillaXSLTProcessor.h"
 #include "nsTreeSanitizer.h"
 #include "nsCellMap.h"
 #include "nsTextFrame.h"
 #include "nsCCUncollectableMarker.h"
 #include "nsTextFragment.h"
@@ -279,33 +273,28 @@ nsLayoutStatics::Initialize()
 
   CacheObserver::Init();
 
   IMEStateManager::Init();
 
   ServiceWorkerRegistrar::Initialize();
 
 #ifdef DEBUG
-#ifdef MOZ_OLD_STYLE
-  GeckoStyleContext::Initialize();
-#endif
   mozilla::LayerAnimationInfo::Initialize();
 #endif
 
   MediaDecoder::InitStatics();
 
   PromiseDebugging::Init();
 
   mozilla::dom::WebCryptoThreadPool::Initialize();
 
-#ifdef MOZ_STYLO
   if (XRE_IsParentProcess() || XRE_IsContentProcess()) {
     InitializeServo();
   }
-#endif
 
 #ifndef MOZ_WIDGET_ANDROID
   // On Android, we instantiate it when constructing AndroidBridge.
   MediaPrefs::GetSingleton();
 #endif
 
   // This must be initialized on the main-thread.
   mozilla::dom::IPCBlobInputStreamStorage::Initialize();
@@ -324,36 +313,31 @@ nsLayoutStatics::Initialize()
 }
 
 void
 nsLayoutStatics::Shutdown()
 {
   // Don't need to shutdown nsWindowMemoryReporter, that will be done by the
   // memory reporter manager.
 
-#ifdef MOZ_STYLO
   if (XRE_IsParentProcess() || XRE_IsContentProcess()) {
     ShutdownServo();
     URLExtraData::ReleaseDummy();
   }
-#endif
 
   nsMessageManagerScriptExecutor::Shutdown();
   nsFocusManager::Shutdown();
 #ifdef MOZ_XUL
   nsXULPopupManager::Shutdown();
 #endif
   StorageObserver::Shutdown();
   txMozillaXSLTProcessor::Shutdown();
   Attr::Shutdown();
   EventListenerManager::Shutdown();
   IMEStateManager::Shutdown();
-#ifdef MOZ_OLD_STYLE
-  nsCSSParser::Shutdown();
-#endif
   nsMediaFeatures::Shutdown();
   nsHTMLDNSPrefetch::Shutdown();
   nsCSSRendering::Shutdown();
   StaticPresData::Shutdown();
 #ifdef DEBUG
   nsFrame::DisplayReflowShutdown();
 #endif
   nsCellMap::Shutdown();
@@ -381,19 +365,16 @@ nsLayoutStatics::Shutdown()
 
   mozilla::css::ErrorReporter::ReleaseGlobals();
 
   nsTextFragment::Shutdown();
 
   nsAttrValue::Shutdown();
   nsContentUtils::Shutdown();
   nsLayoutStylesheetCache::Shutdown();
-#ifdef MOZ_OLD_STYLE
-  RuleProcessorCache::Shutdown();
-#endif
 
   ShutdownJSEnvironment();
   nsGlobalWindowInner::ShutDown();
   nsGlobalWindowOuter::ShutDown();
   nsDOMClassInfo::ShutDown();
   WebIDLGlobalNameHash::Shutdown();
   nsListControlFrame::Shutdown();
   nsXBLService::Shutdown();
--- a/layout/forms/nsMeterFrame.cpp
+++ b/layout/forms/nsMeterFrame.cpp
@@ -15,19 +15,16 @@
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
 #include "nsCheckboxRadioFrame.h"
 #include "nsFontMetrics.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLMeterElement.h"
 #include "nsCSSPseudoElements.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/StyleSetHandleInlines.h"
 #include "nsThemeConstants.h"
 #include <algorithm>
 
 using namespace mozilla;
 using mozilla::dom::Element;
 using mozilla::dom::HTMLMeterElement;
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -16,19 +16,16 @@
 #include "nsGkAtoms.h"
 #include "nsNameSpaceManager.h"
 #include "nsThemeConstants.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventStates.h"
 #include "nsContentUtils.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsCSSPseudoElements.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/StyleSetHandleInlines.h"
 #include "nsThreadUtils.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/dom/MutationEventBinding.h"
 
 #ifdef ACCESSIBILITY
 #include "mozilla/a11y/AccTypes.h"
--- a/layout/forms/nsProgressFrame.cpp
+++ b/layout/forms/nsProgressFrame.cpp
@@ -15,19 +15,16 @@
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
 #include "nsCheckboxRadioFrame.h"
 #include "nsFontMetrics.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/HTMLProgressElement.h"
 #include "nsCSSPseudoElements.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/StyleSetHandleInlines.h"
 #include "nsThemeConstants.h"
 #include <algorithm>
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -75,20 +75,16 @@ void
 nsFirstLetterFrame::SetInitialChildList(ChildListID  aListID,
                                         nsFrameList& aChildList)
 {
   MOZ_ASSERT(aListID == kPrincipalList, "Principal child list is the only "
              "list that nsFirstLetterFrame should set via this function");
   for (nsIFrame* f : aChildList) {
     MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
     MOZ_ASSERT(f->IsTextFrame(), "We should not have kids that are containers!");
-#ifdef MOZ_OLD_STYLE
-    MOZ_ASSERT_IF(f->StyleContext()->IsGecko(),
-                  f->StyleContext()->AsGecko()->GetParent() == StyleContext());
-#endif
     nsLayoutUtils::MarkDescendantsDirty(f); // Drops cached textruns
   }
 
   mFrames.SetFrames(aChildList);
 }
 
 nsresult
 nsFirstLetterFrame::GetChildFrameContainingOffset(int32_t inContentOffset,
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -40,20 +40,16 @@
 #include "nsIScrollableFrame.h"
 #include "nsPresContext.h"
 #include "nsStyleConsts.h"
 #include "nsIPresShell.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Sprintf.h"
 #include "nsLayoutUtils.h"
 #include "LayoutLogging.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoStyleContext.h"
-#include "mozilla/GeckoRestyleManager.h"
-#endif
 #include "mozilla/RestyleManager.h"
 #include "mozilla/RestyleManagerInlines.h"
 #include "nsInlineFrame.h"
 #include "nsIDOMNode.h"
 #include "nsISelection.h"
 #include "nsISelectionPrivate.h"
 #include "nsFrameSelection.h"
 #include "nsGkAtoms.h"
@@ -780,28 +776,17 @@ nsFrame::DestroyFrom(nsIFrame* aDestruct
     // This needs to happen before we clear our Properties() table.
     ActiveLayerTracker::TransferActivityToContent(this, mContent);
 
     // Unfortunately, we need to do this for all frames being reframed
     // and not only those whose current style involves CSS transitions,
     // because what matters is whether the new style (not the old)
     // specifies CSS transitions.
     if (presContext->RestyleManager()->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-      // stylo: ServoRestyleManager does not handle transitions yet, and when
-      // it does it probably won't need to track reframed style contexts to
-      // initiate transitions correctly.
-      GeckoRestyleManager::ReframingStyleContexts* rsc =
-        presContext->RestyleManager()->AsGecko()->GetReframingStyleContexts();
-      if (rsc) {
-        rsc->Put(mContent, mStyleContext->AsGecko());
-      }
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     }
   }
 
   if (HasCSSAnimations() || HasCSSTransitions() ||
       EffectSet::GetEffectSet(this)) {
     // If no new frame for this element is created by the end of the
     // restyling process, stop animations and transitions for this frame
     RestyleManager::AnimationsWithDestroyedFrame* adf =
@@ -7803,30 +7788,16 @@ nsIFrame::ListGeneric(nsACString& aTo, c
   aTo += nsPrintfCString(" [sc=%p", static_cast<void*>(mStyleContext));
   if (mStyleContext) {
     nsAtom* pseudoTag = mStyleContext->GetPseudo();
     if (pseudoTag) {
       nsAutoString atomString;
       pseudoTag->ToString(atomString);
       aTo += nsPrintfCString("%s", NS_LossyConvertUTF16toASCII(atomString).get());
     }
-#ifdef MOZ_OLD_STYLE
-    if (auto* geckoContext = mStyleContext->GetAsGecko()) {
-      if (!geckoContext->GetParent() ||
-          (GetParent() && GetParent()->StyleContext() != geckoContext->GetParent())) {
-        aTo += nsPrintfCString("^%p", geckoContext->GetParent());
-        if (geckoContext->GetParent()) {
-          aTo += nsPrintfCString("^%p", geckoContext->GetParent()->GetParent());
-          if (geckoContext->GetParent()->GetParent()) {
-            aTo += nsPrintfCString("^%p", geckoContext->GetParent()->GetParent()->GetParent());
-          }
-        }
-      }
-    }
-#endif
   }
   aTo += "]";
 }
 
 void
 nsIFrame::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
 {
   nsCString str;
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -24,19 +24,16 @@
 #include "nsCSSAnonBoxes.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsDataHashtable.h"
 #include "nsDisplayList.h"
 #include "nsHashKeys.h"
 #include "nsIFrameInlines.h"
 #include "nsPresContext.h"
 #include "nsReadableUtils.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleNode.h"
-#endif
 #include "nsStyleContext.h"
 #include "nsTableWrapperFrame.h"
 
 using namespace mozilla;
 
 typedef nsAbsoluteContainingBlock::AbsPosReflowFlags AbsPosReflowFlags;
 typedef nsGridContainerFrame::TrackSize TrackSize;
 const uint32_t nsGridContainerFrame::kTranslatedMaxLine =
--- a/layout/inspector/InspectorFontFace.cpp
+++ b/layout/inspector/InspectorFontFace.cpp
@@ -1,19 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #include "InspectorFontFace.h"
 
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRules.h"
-#endif
 #include "gfxTextRun.h"
 #include "gfxUserFontSet.h"
 #include "nsFontFaceLoader.h"
 #include "mozilla/gfx/2D.h"
 #include "brotli/decode.h"
 #include "zlib.h"
 #include "mozilla/dom/FontFaceSet.h"
 #include "mozilla/Unused.h"
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -14,41 +14,30 @@
 #include "nsIServiceManager.h"
 #include "nsString.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "nsIContentInlines.h"
 #include "nsIDOMElement.h"
 #include "nsIDocument.h"
 #include "nsIPresShell.h"
 #include "nsIDOMDocument.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleNode.h"
-#include "nsIStyleRule.h"
-#include "mozilla/css/StyleRule.h"
-#endif
 #include "nsIDOMWindow.h"
 #include "nsXBLBinding.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsIMutableArray.h"
 #include "nsBindingManager.h"
 #include "ChildIterator.h"
 #include "nsComputedDOMStyle.h"
 #include "mozilla/EventStateManager.h"
 #include "nsAtom.h"
 #include "nsRange.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/dom/CharacterData.h"
 #include "mozilla/dom/Element.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleWalker.h"
-#endif
 #include "nsCSSPseudoClasses.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRuleProcessor.h"
-#endif
 #include "mozilla/dom/CSSLexer.h"
 #include "mozilla/dom/InspectorUtilsBinding.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "nsCSSParser.h"
 #include "nsCSSProps.h"
 #include "nsCSSValue.h"
 #include "nsColor.h"
 #include "mozilla/StyleSetHandleInlines.h"
@@ -184,41 +173,17 @@ InspectorUtils::GetCSSStyleRules(GlobalO
   if (!styleContext) {
     // This can fail for elements that are not in the document or
     // if the document they're in doesn't have a presshell.  Bail out.
     return;
   }
 
 
   if (styleContext->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    auto gecko = styleContext->AsGecko();
-    nsRuleNode* ruleNode = gecko->RuleNode();
-    if (!ruleNode) {
-      return;
-    }
-
-    AutoTArray<nsRuleNode*, 16> ruleNodes;
-    while (!ruleNode->IsRoot()) {
-      ruleNodes.AppendElement(ruleNode);
-      ruleNode = ruleNode->GetParent();
-    }
-
-    for (nsRuleNode* ruleNode : Reversed(ruleNodes)) {
-      RefPtr<Declaration> decl = do_QueryObject(ruleNode->GetRule());
-      if (decl) {
-        css::Rule* owningRule = decl->GetOwningRule();
-        if (owningRule) {
-          aResult.AppendElement(owningRule);
-        }
-      }
-    }
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   } else {
     nsIDocument* doc = aElement.OwnerDoc();
     nsIPresShell* shell = doc->GetShell();
     if (!shell) {
       return;
     }
 
     ServoStyleContext* servo = styleContext->AsServo();
@@ -894,52 +859,34 @@ InspectorUtils::RgbToColorName(GlobalObj
 
 /* static */ void
 InspectorUtils::ColorToRGBA(GlobalObject& aGlobalObject,
                             const nsAString& aColorString,
                             Nullable<InspectorRGBATuple>& aResult)
 {
   nscolor color = NS_RGB(0, 0, 0);
 
-#ifdef MOZ_STYLO
   if (!ServoCSSParser::ComputeColor(nullptr, NS_RGB(0, 0, 0), aColorString,
                                     &color)) {
     aResult.SetNull();
     return;
   }
-#else
-  nsCSSParser cssParser;
-  nsCSSValue cssValue;
-
-  if (!cssParser.ParseColorString(aColorString, nullptr, 0, cssValue, true)) {
-    aResult.SetNull();
-    return;
-  }
-
-  nsRuleNode::ComputeColor(cssValue, nullptr, nullptr, color);
-#endif
 
   InspectorRGBATuple& tuple = aResult.SetValue();
   tuple.mR = NS_GET_R(color);
   tuple.mG = NS_GET_G(color);
   tuple.mB = NS_GET_B(color);
   tuple.mA = nsStyleUtil::ColorComponentToFloat(NS_GET_A(color));
 }
 
 /* static */ bool
 InspectorUtils::IsValidCSSColor(GlobalObject& aGlobalObject,
                                 const nsAString& aColorString)
 {
-#ifdef MOZ_STYLO
   return ServoCSSParser::IsValidCSSColor(aColorString);
-#else
-  nsCSSParser cssParser;
-  nsCSSValue cssValue;
-  return cssParser.ParseColorString(aColorString, nullptr, 0, cssValue, true);
-#endif
 }
 
 void
 InspectorUtils::GetBindingURLs(GlobalObject& aGlobalObject,
                                Element& aElement,
                                nsTArray<nsString>& aResult)
 {
   nsXBLBinding* binding = aElement.GetXBLBinding();
@@ -1149,26 +1096,16 @@ InspectorUtils::ClearPseudoClassLocks(Gl
 }
 
 /* static */ void
 InspectorUtils::ParseStyleSheet(GlobalObject& aGlobalObject,
                                 StyleSheet& aSheet,
                                 const nsAString& aInput,
                                 ErrorResult& aRv)
 {
-#ifdef MOZ_OLD_STYLE
-  RefPtr<CSSStyleSheet> geckoSheet = do_QueryObject(&aSheet);
-  if (geckoSheet) {
-    nsresult rv = geckoSheet->ReparseSheet(aInput);
-    if (NS_FAILED(rv)) {
-      aRv.Throw(rv);
-    }
-    return;
-  }
-#endif
 
   RefPtr<ServoStyleSheet> servoSheet = do_QueryObject(&aSheet);
   if (servoSheet) {
     nsresult rv = servoSheet->ReparseSheet(aInput);
     if (NS_FAILED(rv)) {
       aRv.Throw(rv);
     }
     return;
--- a/layout/mathml/nsMathMLTokenFrame.cpp
+++ b/layout/mathml/nsMathMLTokenFrame.cpp
@@ -3,19 +3,16 @@
 /* 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/. */
 
 #include "nsMathMLTokenFrame.h"
 #include "nsPresContext.h"
 #include "nsContentUtils.h"
 #include "nsTextFrame.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoRestyleManager.h"
-#endif
 #include <algorithm>
 
 using namespace mozilla;
 
 nsIFrame*
 NS_NewMathMLTokenFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
 {
   return new (aPresShell) nsMathMLTokenFrame(aContext);
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -73,19 +73,16 @@
 #include "mozilla/gfx/gfxVars.h"
 #include "ActiveLayerTracker.h"
 #include "nsContentUtils.h"
 #include "nsPrintfCString.h"
 #include "UnitTransforms.h"
 #include "LayersLogging.h"
 #include "FrameLayerBuilder.h"
 #include "mozilla/EventStateManager.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoRestyleManager.h"
-#endif
 #include "nsCaret.h"
 #include "nsISelection.h"
 #include "nsDOMTokenList.h"
 #include "mozilla/RuleNodeCacheConditions.h"
 #include "nsCSSProps.h"
 #include "nsSVGMaskFrame.h"
 #include "nsTableCellFrame.h"
 #include "nsTableColFrame.h"
@@ -174,21 +171,17 @@ static void AddTransformFunctions(const 
                                   TransformReferenceBox& aRefBox,
                                   InfallibleTArray<TransformFunction>& aFunctions)
 {
   if (aList->mValue.GetUnit() == eCSSUnit_None) {
     return;
   }
 
   GeckoStyleContext* contextIfGecko =
-#ifdef MOZ_OLD_STYLE
-    aContext ? aContext->GetAsGecko() : nullptr;
-#else
     nullptr;
-#endif
 
   for (const nsCSSValueList* curr = aList; curr; curr = curr->mNext) {
     const nsCSSValue& currElem = curr->mValue;
     NS_ASSERTION(currElem.GetUnit() == eCSSUnit_Function,
                  "Stream should consist solely of functions!");
     nsCSSValue::Array* array = currElem.GetArrayValue();
     RuleNodeCacheConditions conditions;
     switch (nsStyleTransformMatrix::TransformFunctionOf(array)) {
@@ -482,23 +475,17 @@ 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/AnimationCollection.cpp
+++ b/layout/style/AnimationCollection.cpp
@@ -111,25 +111,16 @@ AnimationCollection<AnimationType>::GetO
 
     *aCreatedCollection = true;
     aElement->SetMayHaveAnimations();
   }
 
   return collection;
 }
 
-#ifdef MOZ_OLD_STYLE
-template <class AnimationType>
-void
-AnimationCollection<AnimationType>::UpdateCheckGeneration(
-  nsPresContext* aPresContext)
-{
-  mCheckGeneration = aPresContext->RestyleManager()->GetAnimationGeneration();
-}
-#endif
 
 template<class AnimationType>
 /*static*/ nsAtom*
 AnimationCollection<AnimationType>::GetPropertyAtomForPseudoType(
   CSSPseudoElementType aPseudoType)
 {
   nsAtom* propName = nullptr;
 
--- a/layout/style/AnimationCollection.h
+++ b/layout/style/AnimationCollection.h
@@ -33,19 +33,16 @@ class AnimationCollection
   : public LinkedListElement<AnimationCollection<AnimationType>>
 {
   typedef AnimationCollection<AnimationType> SelfType;
   typedef AnimationTypeTraits<AnimationType> TraitsType;
 
   AnimationCollection(dom::Element* aElement, nsAtom* aElementProperty)
     : mElement(aElement)
     , mElementProperty(aElementProperty)
-#ifdef MOZ_OLD_STYLE
-    , mCheckGeneration(0)
-#endif
 #ifdef DEBUG
     , mCalledPropertyDtor(false)
 #endif
   {
     MOZ_COUNT_CTOR(AnimationCollection);
   }
 
 public:
@@ -93,27 +90,16 @@ public:
   dom::Element *mElement;
 
   // the atom we use in mElement's prop table (must be a static atom,
   // i.e., in an atom list)
   nsAtom *mElementProperty;
 
   InfallibleTArray<RefPtr<AnimationType>> mAnimations;
 
-#ifdef MOZ_OLD_STYLE
-  // For CSS transitions only, we record the most recent generation
-  // for which we've done the transition update, so that we avoid doing
-  // it more than once per style change.
-  // (Note that we also store an animation generation on each EffectSet in
-  // order to track when we need to update animations on layers.)
-  uint64_t mCheckGeneration;
-
-  // Update mCheckGeneration to RestyleManager's count
-  void UpdateCheckGeneration(nsPresContext* aPresContext);
-#endif
 
 private:
   static nsAtom* GetPropertyAtomForPseudoType(
     CSSPseudoElementType aPseudoType);
 
 #ifdef DEBUG
   bool mCalledPropertyDtor;
 #endif
--- a/layout/style/CSS.cpp
+++ b/layout/style/CSS.cpp
@@ -64,23 +64,17 @@ CSS::Supports(const GlobalObject& aGloba
   }
 
   if (info.mStyleBackendType == StyleBackendType::Servo) {
     NS_ConvertUTF16toUTF8 property(aProperty);
     NS_ConvertUTF16toUTF8 value(aValue);
     return Servo_CSSSupports2(&property, &value);
   }
 
-#ifdef MOZ_OLD_STYLE
-  nsCSSParser parser;
-  return parser.EvaluateSupportsDeclaration(aProperty, aValue, info.mDocURI,
-                                            info.mBaseURI, info.mPrincipal);
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 /* static */ bool
 CSS::Supports(const GlobalObject& aGlobal,
               const nsAString& aCondition,
               ErrorResult& aRv)
 {
   SupportsParsingInfo info;
@@ -91,25 +85,18 @@ CSS::Supports(const GlobalObject& aGloba
     return false;
   }
 
   if (info.mStyleBackendType == StyleBackendType::Servo) {
     NS_ConvertUTF16toUTF8 cond(aCondition);
     return Servo_CSSSupports(&cond);
   }
 
-#ifdef MOZ_OLD_STYLE
-  nsCSSParser parser;
-  return parser.EvaluateSupportsCondition(aCondition, info.mDocURI,
-                                          info.mBaseURI, info.mPrincipal,
-                                          css::SupportsParsingSettings::ImpliedParentheses);
-#else
   MOZ_CRASH("old style system disabled");
   return false;
-#endif
 }
 
 /* static */ void
 CSS::Escape(const GlobalObject& aGlobal,
             const nsAString& aIdent,
             nsAString& aReturn)
 {
   nsStyleUtil::AppendEscapedCSSIdent(aIdent, aReturn);
--- a/layout/style/CSSKeyframesRule.cpp
+++ b/layout/style/CSSKeyframesRule.cpp
@@ -6,25 +6,16 @@
 
 #include "mozilla/dom/CSSKeyframesRule.h"
 
 #include "mozilla/dom/CSSKeyframesRuleBinding.h"
 
 namespace mozilla {
 namespace dom {
 
-#ifdef MOZ_OLD_STYLE
-/* virtual */ bool
-CSSKeyframesRule::UseForPresentation(nsPresContext* aPresContext,
-                                     nsMediaQueryResultCacheKey& aKey)
-{
-  MOZ_ASSERT_UNREACHABLE("should not be called");
-  return false;
-}
-#endif
 
 /* virtual */ JSObject*
 CSSKeyframesRule::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return CSSKeyframesRuleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
--- a/layout/style/CSSKeyframesRule.h
+++ b/layout/style/CSSKeyframesRule.h
@@ -26,20 +26,16 @@ public:
   uint16_t Type() const final { return CSSRuleBinding::KEYFRAMES_RULE; }
   virtual void GetName(nsAString& aName) const = 0;
   virtual void SetName(const nsAString& aName) = 0;
   virtual CSSRuleList* CssRules() = 0;
   virtual void AppendRule(const nsAString& aRule) = 0;
   virtual void DeleteRule(const nsAString& aKey) = 0;
   virtual CSSKeyframeRule* FindRule(const nsAString& aKey) = 0;
 
-#ifdef MOZ_OLD_STYLE
-  bool UseForPresentation(nsPresContext* aPresContext,
-                          nsMediaQueryResultCacheKey& aKey) final;
-#endif
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override = 0;
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/layout/style/CSSStyleSheet.cpp
+++ b/layout/style/CSSStyleSheet.cpp
@@ -30,19 +30,16 @@
 #include "nsCSSParser.h"
 #include "mozilla/css/Loader.h"
 #include "nsNameSpaceManager.h"
 #include "nsXMLNameSpaceMap.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "mozAutoDocUpdate.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleNode.h"
-#endif
 #include "nsMediaFeatures.h"
 #include "nsDOMClassInfoID.h"
 #include "mozilla/Likely.h"
 #include "nsComponentManagerUtils.h"
 #include "NullPrincipal.h"
 #include "mozilla/RuleProcessorCache.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "nsDOMWindowUtils.h"
--- a/layout/style/CounterStyleManager.cpp
+++ b/layout/style/CounterStyleManager.cpp
@@ -9,19 +9,16 @@
 #include "mozilla/ArenaObjectID.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/Types.h"
 #include "mozilla/WritingModes.h"
 #include "nsCSSCounterStyleRule.h"
 #include "nsString.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "nsTArray.h"
 #include "nsTHashtable.h"
 #include "nsUnicodeProperties.h"
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/StyleSetHandleInlines.h"
 
 namespace mozilla {
 
--- a/layout/style/DeclarationBlockInlines.h
+++ b/layout/style/DeclarationBlockInlines.h
@@ -2,19 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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_DeclarationBlockInlines_h
 #define mozilla_DeclarationBlockInlines_h
 
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/Declaration.h"
-#endif
 #include "mozilla/ServoDeclarationBlock.h"
 
 namespace mozilla {
 
 MOZ_DEFINE_STYLO_METHODS(DeclarationBlock, css::Declaration, ServoDeclarationBlock)
 
 MozExternalRefCountType
 DeclarationBlock::AddRef()
@@ -28,36 +25,27 @@ DeclarationBlock::Release()
   MOZ_STYLO_FORWARD(Release, ())
 }
 
 already_AddRefed<DeclarationBlock>
 DeclarationBlock::Clone() const
 {
   RefPtr<DeclarationBlock> result;
   if (IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-    result = new css::Declaration(*AsGecko());
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   } else {
     result = new ServoDeclarationBlock(*AsServo());
   }
   return result.forget();
 }
 
 already_AddRefed<DeclarationBlock>
 DeclarationBlock::EnsureMutable()
 {
 #ifdef DEBUG
-#ifdef MOZ_OLD_STYLE
-  if (IsGecko()) {
-    AsGecko()->AssertNotExpanded();
-  }
-#endif
 #endif
   if (IsServo() && !IsDirty()) {
     // In stylo, the old DeclarationBlock is stored in element's rule node tree
     // directly, to avoid new values replacing the DeclarationBlock in the tree
     // directly, we need to copy the old one here if we haven't yet copied.
     // As a result the new value does not replace rule node tree until traversal
     // happens.
     return Clone();
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -537,31 +537,17 @@ FontFace::ParseDescriptor(nsCSSFontDesc 
   nsCOMPtr<nsIURI> docURI = window->GetDocumentURI();
   nsCOMPtr<nsIURI> base = window->GetDocBaseURI();
 
   if (mFontFaceSet->Document()->IsStyledByServo()) {
     RefPtr<URLExtraData> url = new URLExtraData(base, docURI, principal);
     return ServoCSSParser::ParseFontDescriptor(aDescID, aString, url, aResult);
   }
 
-#ifdef MOZ_OLD_STYLE
-  nsCSSParser parser;
-  if (!parser.ParseFontFaceDescriptor(aDescID, aString,
-                                      docURI, // aSheetURL
-                                      base,
-                                      principal,
-                                      aResult)) {
-    aResult.Reset();
-    return false;
-  }
-
-  return true;
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 void
 FontFace::SetDescriptor(nsCSSFontDesc aFontDesc,
                         const nsAString& aValue,
                         ErrorResult& aRv)
 {
   NS_ASSERTION(!HasRule(),
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -4,19 +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 "FontFaceSet.h"
 
 #include "gfxFontConstants.h"
 #include "gfxFontSrcPrincipal.h"
 #include "gfxFontSrcURI.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/Declaration.h"
-#endif
 #include "mozilla/css/Loader.h"
 #include "mozilla/dom/FontFaceSetBinding.h"
 #include "mozilla/dom/FontFaceSetIterator.h"
 #include "mozilla/dom/FontFaceSetLoadEvent.h"
 #include "mozilla/dom/FontFaceSetLoadEventBinding.h"
 #include "mozilla/dom/Promise.h"
 #include "mozilla/net/ReferrerPolicy.h"
 #include "mozilla/AsyncEventDispatcher.h"
@@ -45,19 +42,16 @@
 #include "nsISupportsPriority.h"
 #include "nsIWebNavigation.h"
 #include "nsNetUtil.h"
 #include "nsIProtocolHandler.h"
 #include "nsIInputStream.h"
 #include "nsLayoutUtils.h"
 #include "nsPresContext.h"
 #include "nsPrintfCString.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "nsUTF8Utils.h"
 #include "nsDOMNavigationTiming.h"
 #include "StylePrefs.h"
 
 using namespace mozilla;
 using namespace mozilla::css;
 using namespace mozilla::dom;
 
@@ -222,72 +216,17 @@ FontFaceSet::ParseFontShorthandForMatchi
       return;
     }
     aWeight = weight.GetIntValue();
     aStretch = stretch.GetIntValue();
     aStyle = style.GetIntValue();
     return;
   }
 
-#ifdef MOZ_OLD_STYLE
-  // Parse aFont as a 'font' property value.
-  RefPtr<Declaration> declaration = new Declaration;
-  declaration->InitializeEmpty();
-
-  bool changed = false;
-  nsCSSParser parser;
-  parser.ParseProperty(eCSSProperty_font,
-                       aFont,
-                       mDocument->GetDocumentURI(),
-                       mDocument->GetDocumentURI(),
-                       mDocument->NodePrincipal(),
-                       declaration,
-                       &changed,
-                       /* aIsImportant */ false);
-
-  // All of the properties we are interested in should have been set at once.
-  MOZ_ASSERT(changed == (declaration->HasProperty(eCSSProperty_font_family) &&
-                         declaration->HasProperty(eCSSProperty_font_style) &&
-                         declaration->HasProperty(eCSSProperty_font_weight) &&
-                         declaration->HasProperty(eCSSProperty_font_stretch)));
-
-  if (!changed) {
-    aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
-    return;
-  }
-
-  nsCSSCompressedDataBlock* data = declaration->GetNormalBlock();
-  MOZ_ASSERT(!declaration->GetImportantBlock());
-
-  const nsCSSValue* family = data->ValueFor(eCSSProperty_font_family);
-  if (family->GetUnit() != eCSSUnit_FontFamilyList) {
-    // We got inherit, initial, unset, a system font, or a token stream.
-    aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
-    return;
-  }
-
-  aFamilyList = family->GetFontFamilyListValue();
-
-  int32_t weight = data->ValueFor(eCSSProperty_font_weight)->GetIntValue();
-
-  // Resolve relative font weights against the initial of font-weight
-  // (normal, which is equivalent to 400).
-  if (weight == NS_STYLE_FONT_WEIGHT_BOLDER) {
-    weight = NS_FONT_WEIGHT_BOLD;
-  } else if (weight == NS_STYLE_FONT_WEIGHT_LIGHTER) {
-    weight = NS_FONT_WEIGHT_THIN;
-  }
-
-  aWeight = weight;
-
-  aStretch = data->ValueFor(eCSSProperty_font_stretch)->GetIntValue();
-  aStyle = data->ValueFor(eCSSProperty_font_style)->GetIntValue();
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 static bool
 HasAnyCharacterInUnicodeRange(gfxUserFontEntry* aEntry,
                               const nsAString& aInput)
 {
   const char16_t* p = aInput.Data();
   const char16_t* end = p + aInput.Length();
--- a/layout/style/GenericSpecifiedValuesInlines.h
+++ b/layout/style/GenericSpecifiedValuesInlines.h
@@ -9,19 +9,16 @@
  * nsRuleData methods when compiled without stylo, but will do
  * virtual dispatch (by checking which kind of container it is)
  * in stylo mode.
  */
 
 #ifndef mozilla_GenericSpecifiedValuesInlines_h
 #define mozilla_GenericSpecifiedValuesInlines_h
 
-#ifdef MOZ_OLD_STYLE
-#include "nsRuleData.h"
-#endif
 #include "mozilla/GenericSpecifiedValues.h"
 #include "mozilla/ServoSpecifiedValues.h"
 
 namespace mozilla {
 
 MOZ_DEFINE_STYLO_METHODS(GenericSpecifiedValues,
                          nsRuleData,
                          ServoSpecifiedValues)
@@ -31,21 +28,17 @@ GenericSpecifiedValues::ShouldIgnoreColo
 {
   if (IsServo()) {
     // Servo handles this during cascading.
     //
     // FIXME(emilio): We should eventually move it to the document though.
     return false;
   }
 
-#ifdef MOZ_OLD_STYLE
-  return !AsGecko()->mPresContext->UseDocumentColors();
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 bool
 GenericSpecifiedValues::PropertyIsSet(nsCSSPropertyID aId)
 {
   MOZ_STYLO_FORWARD(PropertyIsSet, (aId))
 }
 
@@ -78,39 +71,21 @@ GenericSpecifiedValues::SetIdentAtomValu
   if (!PropertyIsSet(aId)) {
     SetIdentAtomValue(aId, aValue);
   }
 }
 
 void
 GenericSpecifiedValues::SetKeywordValue(nsCSSPropertyID aId, int32_t aValue)
 {
-#ifdef MOZ_OLD_STYLE
-  // there are some static asserts in MOZ_STYLO_FORWARD which
-  // won't work with the overloaded SetKeywordValue function,
-  // so we copy its expansion and use SetIntValue for decltype
-  // instead
-  static_assert(
-    !mozilla::IsSame<decltype(&MOZ_STYLO_THIS_TYPE::SetIntValue),
-                     decltype(&MOZ_STYLO_GECKO_TYPE::SetKeywordValue)>::value,
-    "Gecko subclass should define its own SetKeywordValue");
-  static_assert(
-    !mozilla::IsSame<decltype(&MOZ_STYLO_THIS_TYPE::SetIntValue),
-                     decltype(&MOZ_STYLO_SERVO_TYPE::SetKeywordValue)>::value,
-    "Servo subclass should define its own SetKeywordValue");
-#endif
 
   if (IsServo()) {
     return AsServo()->SetKeywordValue(aId, aValue);
   }
-#ifdef MOZ_OLD_STYLE
-  return AsGecko()->SetKeywordValue(aId, aValue);
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 void
 GenericSpecifiedValues::SetKeywordValueIfUnset(nsCSSPropertyID aId,
                                                int32_t aValue)
 {
   if (!PropertyIsSet(aId)) {
     SetKeywordValue(aId, aValue);
--- a/layout/style/GroupRule.cpp
+++ b/layout/style/GroupRule.cpp
@@ -13,200 +13,21 @@
 
 #include "mozilla/dom/CSSRuleList.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 namespace css {
 
-#ifdef MOZ_OLD_STYLE
-#define CALL_INNER(inner_, call_)               \
-  ((inner_).is<GeckoGroupRuleRules>()           \
-    ? (inner_).as<GeckoGroupRuleRules>().call_  \
-    : (inner_).as<ServoGroupRuleRules>().call_)
-#else
 #define CALL_INNER(inner_, call_)               \
   ((inner_).is<DummyGroupRuleRules>()           \
     ? (inner_).as<DummyGroupRuleRules>().call_  \
     : (inner_).as<ServoGroupRuleRules>().call_)
-#endif
 
-#ifdef MOZ_OLD_STYLE
-// -------------------------------
-// Style Rule List for group rules
-//
-
-class GroupRuleRuleList final : public dom::CSSRuleList
-{
-public:
-  explicit GroupRuleRuleList(GroupRule *aGroupRule);
-
-  virtual CSSStyleSheet* GetParentObject() override;
-
-  virtual Rule*
-  IndexedGetter(uint32_t aIndex, bool& aFound) override;
-  virtual uint32_t
-  Length() override;
-
-  void DropReference() { mGroupRule = nullptr; }
-
-private:
-  ~GroupRuleRuleList();
-
-private:
-  GroupRule* mGroupRule;
-};
-
-GroupRuleRuleList::GroupRuleRuleList(GroupRule *aGroupRule)
-{
-  // Not reference counted to avoid circular references.
-  // The rule will tell us when its going away.
-  mGroupRule = aGroupRule;
-}
-
-GroupRuleRuleList::~GroupRuleRuleList()
-{
-}
-
-CSSStyleSheet*
-GroupRuleRuleList::GetParentObject()
-{
-  if (!mGroupRule) {
-    return nullptr;
-  }
-  StyleSheet* sheet = mGroupRule->GetStyleSheet();
-  return sheet ? sheet->AsGecko() : nullptr;
-}
-
-uint32_t
-GroupRuleRuleList::Length()
-{
-  if (!mGroupRule) {
-    return 0;
-  }
-
-  return AssertedCast<uint32_t>(mGroupRule->StyleRuleCount());
-}
-
-Rule*
-GroupRuleRuleList::IndexedGetter(uint32_t aIndex, bool& aFound)
-{
-  aFound = false;
-
-  if (mGroupRule) {
-    RefPtr<Rule> rule = mGroupRule->GetStyleRuleAt(aIndex);
-    if (rule) {
-      aFound = true;
-      return rule;
-    }
-  }
-
-  return nullptr;
-}
-
-// -------------------------------
-// GeckoGroupRuleRules
-//
-
-GeckoGroupRuleRules::GeckoGroupRuleRules()
-{
-}
-
-GeckoGroupRuleRules::GeckoGroupRuleRules(GeckoGroupRuleRules&& aOther)
-  : mRules(Move(aOther.mRules))
-  , mRuleCollection(Move(aOther.mRuleCollection))
-{
-}
-
-GeckoGroupRuleRules::GeckoGroupRuleRules(const GeckoGroupRuleRules& aCopy)
-{
-  for (const Rule* rule : aCopy.mRules) {
-    RefPtr<Rule> clone = rule->Clone();
-    mRules.AppendObject(clone);
-  }
-}
-
-GeckoGroupRuleRules::~GeckoGroupRuleRules()
-{
-  for (Rule* rule : mRules) {
-    rule->SetParentRule(nullptr);
-  }
-  if (mRuleCollection) {
-    mRuleCollection->DropReference();
-  }
-}
-
-void
-GeckoGroupRuleRules::Clear()
-{
-  mRules.Clear();
-  if (mRuleCollection) {
-    mRuleCollection->DropReference();
-    mRuleCollection = nullptr;
-  }
-}
-
-void
-GeckoGroupRuleRules::Traverse(nsCycleCollectionTraversalCallback& cb)
-{
-  IncrementalClearCOMRuleArray& rules = mRules;
-  for (int32_t i = 0, count = rules.Count(); i < count; ++i) {
-    if (!rules[i]->IsCCLeaf()) {
-      NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mRules[i]");
-      cb.NoteXPCOMChild(rules[i]);
-    }
-  }
-  ImplCycleCollectionTraverse(cb, mRuleCollection, "mRuleCollection");
-}
-
-#ifdef DEBUG
-void
-GeckoGroupRuleRules::List(FILE* out, int32_t aIndent) const
-{
-  for (const Rule* rule : mRules) {
-    rule->List(out, aIndent + 1);
-  }
-}
-#endif
-
-nsresult
-GeckoGroupRuleRules::DeleteStyleRuleAt(uint32_t aIndex)
-{
-  Rule* rule = mRules.SafeObjectAt(aIndex);
-  if (rule) {
-    rule->SetStyleSheet(nullptr);
-    rule->SetParentRule(nullptr);
-  }
-  return mRules.RemoveObjectAt(aIndex) ? NS_OK : NS_ERROR_ILLEGAL_VALUE;
-}
-
-CSSRuleList*
-GeckoGroupRuleRules::CssRules(GroupRule* aParentRule)
-{
-  if (!mRuleCollection) {
-    mRuleCollection = new GroupRuleRuleList(aParentRule);
-  }
-  return mRuleCollection;
-}
-
-size_t
-GeckoGroupRuleRules::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
-{
-  size_t n = mRules.ShallowSizeOfExcludingThis(aMallocSizeOf);
-  for (const Rule* rule : mRules) {
-    n += rule->SizeOfIncludingThis(aMallocSizeOf);
-  }
-
-  // Measurement of the following members may be added later if DMD finds it is
-  // worthwhile:
-  // - mRuleCollection
-  return n;
-}
-#endif
 
 // -------------------------------
 // ServoGroupRuleRules
 //
 
 ServoGroupRuleRules::~ServoGroupRuleRules()
 {
   if (mRuleList) {
@@ -230,21 +51,17 @@ ServoGroupRuleRules::SizeOfExcludingThis
 }
 
 // -------------------------------
 // GroupRule
 //
 
 GroupRule::GroupRule(uint32_t aLineNumber, uint32_t aColumnNumber)
   : Rule(aLineNumber, aColumnNumber)
-#ifdef MOZ_OLD_STYLE
-  , mInner(GeckoGroupRuleRules())
-#else
   , mInner(DummyGroupRuleRules())
-#endif
 {
 }
 
 GroupRule::GroupRule(already_AddRefed<ServoCssRules> aRules,
                      uint32_t aLineNumber, uint32_t aColumnNumber)
   : Rule(aLineNumber, aColumnNumber)
   , mInner(ServoGroupRuleRules(Move(aRules)))
 {
@@ -304,65 +121,16 @@ GroupRule::SetStyleSheet(StyleSheet* aSh
   // depth when seting the sheet to null during unlink, if we happen to unlin in
   // order from most nested rule up to least nested rule.
   if (aSheet != GetStyleSheet()) {
     CALL_INNER(mInner, SetStyleSheet(aSheet));
     Rule::SetStyleSheet(aSheet);
   }
 }
 
-#ifdef MOZ_OLD_STYLE
-void
-GroupRule::AppendStyleRule(Rule* aRule)
-{
-  GeckoRules().AppendObject(aRule);
-  StyleSheet* sheet = GetStyleSheet();
-  aRule->SetStyleSheet(sheet);
-  aRule->SetParentRule(this);
-  if (sheet) {
-    sheet->RuleChanged(this);
-  }
-}
-
-bool
-GroupRule::EnumerateRulesForwards(RuleEnumFunc aFunc, void * aData) const
-{
-  for (const Rule* rule : GeckoRules()) {
-    if (!aFunc(const_cast<Rule*>(rule), aData)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-nsresult
-GroupRule::InsertStyleRuleAt(uint32_t aIndex, Rule* aRule)
-{
-  aRule->SetStyleSheet(GetStyleSheet());
-  aRule->SetParentRule(this);
-  if (!GeckoRules().InsertObjectAt(aRule, aIndex)) {
-    return NS_ERROR_FAILURE;
-  }
-  return NS_OK;
-}
-
-void
-GroupRule::AppendRulesToCssText(nsAString& aCssText) const
-{
-  aCssText.AppendLiteral(" {\n");
-  for (const Rule* rule : GeckoRules()) {
-    nsAutoString cssText;
-    rule->GetCssText(cssText);
-    aCssText.AppendLiteral("  ");
-    aCssText.Append(cssText);
-    aCssText.Append('\n');
-  }
-  aCssText.Append('}');
-}
-#endif
 
 CSSRuleList*
 GroupRule::CssRules()
 {
   return CALL_INNER(mInner, CssRules(this));
 }
 
 uint32_t
--- a/layout/style/GroupRule.h
+++ b/layout/style/GroupRule.h
@@ -9,19 +9,16 @@
  * rules, such as @media rules
  */
 
 #ifndef mozilla_css_GroupRule_h__
 #define mozilla_css_GroupRule_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/ErrorResult.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/IncrementalClearCOMRuleArray.h"
-#endif
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/ServoCSSRuleList.h"
 #include "mozilla/Variant.h"
 #include "mozilla/css/Rule.h"
 #include "nsCycleCollectionParticipant.h"
 
 class nsPresContext;
 class nsMediaQueryResultCacheKey;
@@ -34,57 +31,16 @@ namespace dom {
 class CSSRuleList;
 } // namespace dom
 
 namespace css {
 
 class GroupRule;
 class GroupRuleRuleList;
 
-#ifdef MOZ_OLD_STYLE
-struct GeckoGroupRuleRules
-{
-  GeckoGroupRuleRules();
-  GeckoGroupRuleRules(GeckoGroupRuleRules&& aOther);
-  GeckoGroupRuleRules(const GeckoGroupRuleRules& aCopy);
-  ~GeckoGroupRuleRules();
-
-  void SetParentRule(GroupRule* aParentRule) {
-    for (Rule* rule : mRules) {
-      rule->SetParentRule(aParentRule);
-    }
-  }
-  void SetStyleSheet(StyleSheet* aSheet) {
-    for (Rule* rule : mRules) {
-      rule->SetStyleSheet(aSheet);
-    }
-  }
-
-  void Clear();
-  void Traverse(nsCycleCollectionTraversalCallback& cb);
-
-#ifdef DEBUG
-  void List(FILE* out, int32_t aIndent) const;
-#endif
-
-  int32_t StyleRuleCount() const { return mRules.Count(); }
-  Rule* GetStyleRuleAt(int32_t aIndex) const {
-    return mRules.SafeObjectAt(aIndex);
-  }
-
-  nsresult DeleteStyleRuleAt(uint32_t aIndex);
-
-  dom::CSSRuleList* CssRules(GroupRule* aParentRule);
-
-  size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;
-
-  IncrementalClearCOMRuleArray mRules;
-  RefPtr<GroupRuleRuleList> mRuleCollection; // lazily constructed
-};
-#endif
 
 struct ServoGroupRuleRules
 {
   explicit ServoGroupRuleRules(already_AddRefed<ServoCssRules> aRawRules)
     : mRuleList(new ServoCSSRuleList(Move(aRawRules), nullptr)) {}
   ServoGroupRuleRules(ServoGroupRuleRules&& aOther)
     : mRuleList(Move(aOther.mRuleList)) {}
   ServoGroupRuleRules(const ServoGroupRuleRules& aCopy) {
@@ -147,31 +103,22 @@ struct DummyGroupRuleRules
 #endif
   int32_t StyleRuleCount() const { return 0; }
   Rule* GetStyleRuleAt(int32_t aIndex) const { return nullptr; }
   nsresult DeleteStyleRuleAt(uint32_t aIndex) { return NS_ERROR_NOT_IMPLEMENTED; }
   dom::CSSRuleList* CssRules(GroupRule* aParentRule) { return nullptr; }
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const { return 0; }
 };
 
-#ifdef MOZ_OLD_STYLE
-#define REDIRECT_TO_INNER(call_)                   \
-  if (mInner.is<GeckoGroupRuleRules>()) {          \
-    return mInner.as<GeckoGroupRuleRules>().call_; \
-  } else {                                         \
-    return mInner.as<ServoGroupRuleRules>().call_; \
-  }
-#else
 #define REDIRECT_TO_INNER(call_)                   \
   if (mInner.is<DummyGroupRuleRules>()) {          \
     return mInner.as<DummyGroupRuleRules>().call_; \
   } else {                                         \
     return mInner.as<ServoGroupRuleRules>().call_; \
   }
-#endif
 
 // inherits from Rule so it can be shared between
 // MediaRule and DocumentRule
 class GroupRule : public Rule
 {
 protected:
   GroupRule(uint32_t aLineNumber, uint32_t aColumnNumber);
   GroupRule(already_AddRefed<ServoCssRules> aRules,
@@ -187,82 +134,54 @@ public:
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const override {
     REDIRECT_TO_INNER(List(out, aIndent))
   }
 #endif
   virtual void SetStyleSheet(StyleSheet* aSheet) override;
 
 public:
-#ifdef MOZ_OLD_STYLE
-  void AppendStyleRule(Rule* aRule);
-#endif
 
   int32_t StyleRuleCount() const {
     REDIRECT_TO_INNER(StyleRuleCount())
   }
   Rule* GetStyleRuleAt(uint32_t aIndex) const {
     REDIRECT_TO_INNER(GetStyleRuleAt(aIndex))
   }
 
-#ifdef MOZ_OLD_STYLE
-  typedef bool (*RuleEnumFunc)(Rule* aElement, void* aData);
-  bool EnumerateRulesForwards(RuleEnumFunc aFunc, void * aData) const;
-#endif
 
   /*
    * The next two methods should never be called unless you have first
    * called WillDirty() on the parent stylesheet.  After they are
    * called, DidDirty() needs to be called on the sheet.
    */
   nsresult DeleteStyleRuleAt(uint32_t aIndex) {
     REDIRECT_TO_INNER(DeleteStyleRuleAt(aIndex));
   }
-#ifdef MOZ_OLD_STYLE
-  nsresult InsertStyleRuleAt(uint32_t aIndex, Rule* aRule);
-
-  virtual bool UseForPresentation(nsPresContext* aPresContext,
-                                    nsMediaQueryResultCacheKey& aKey) = 0;
-#endif
 
   // non-virtual -- it is only called by subclasses
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
     REDIRECT_TO_INNER(SizeOfExcludingThis(aMallocSizeOf))
   }
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override = 0;
 
   // WebIDL API
   dom::CSSRuleList* CssRules();
   uint32_t InsertRule(const nsAString& aRule, uint32_t aIndex,
                       ErrorResult& aRv);
   void DeleteRule(uint32_t aIndex, ErrorResult& aRv);
 
 protected:
-#ifdef MOZ_OLD_STYLE
-  void AppendRulesToCssText(nsAString& aCssText) const;
-
-  // Must only be called if this is a Gecko GroupRule.
-  IncrementalClearCOMRuleArray& GeckoRules() {
-    return mInner.as<GeckoGroupRuleRules>().mRules;
-  }
-  const IncrementalClearCOMRuleArray& GeckoRules() const {
-    return mInner.as<GeckoGroupRuleRules>().mRules;
-  }
-#endif
 
 private:
-#ifdef MOZ_OLD_STYLE
-  Variant<GeckoGroupRuleRules, ServoGroupRuleRules> mInner;
-#else
   // This only reason for the DummyGroupRuleRules is that ServoKeyframesRule
   // inherits from CSSKeyframesRules (and thus GroupRule). Once
   // ServoKeyframesRule can be made to inherit from Rule, the
   // DummyGroupRuleRules can be removed.
   Variant<DummyGroupRuleRules, ServoGroupRuleRules> mInner;
-#endif
 };
 
 #undef REDIRECT_TO_INNER
 
 // Implementation of WebIDL CSSConditionRule.
 class ConditionRule : public GroupRule
 {
 protected:
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -34,19 +34,16 @@
 #include "nsIHttpChannel.h"
 #include "nsIHttpChannelInternal.h"
 #include "nsIClassOfService.h"
 #include "nsIScriptError.h"
 #include "nsMimeTypes.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "nsICSSLoaderObserver.h"
 #include "nsCSSParser.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/ImportRule.h"
-#endif
 #include "nsThreadUtils.h"
 #include "nsGkAtoms.h"
 #include "nsIThreadInternal.h"
 #include "nsINetworkPredictor.h"
 #include "nsStringStream.h"
 #include "mozilla/dom/MediaList.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/dom/URL.h"
@@ -1113,21 +1110,17 @@ Loader::CreateSheet(nsIURI* aURI,
       if (mDocument && mDocument->GetDocumentURI()) {
         mDocument->GetDocumentURI()->GetAsciiSpec(sourceUri);
       }
       SRICheck::IntegrityMetadata(aIntegrity, sourceUri, mReporter,
                                   &sriMetadata);
     }
 
     if (GetStyleBackendType() == StyleBackendType::Gecko) {
-#ifdef MOZ_OLD_STYLE
-      *aSheet = new CSSStyleSheet(aParsingMode, aCORSMode, aReferrerPolicy, sriMetadata);
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     } else {
       *aSheet = new ServoStyleSheet(aParsingMode, aCORSMode, aReferrerPolicy, sriMetadata);
     }
     (*aSheet)->SetURIs(sheetURI, originalURI, baseURI);
   }
 
   NS_ASSERTION(*aSheet, "We should have a sheet by now!");
   NS_ASSERTION(aSheetState != eSheetStateUnknown, "Have to set a state!");
@@ -1265,21 +1258,17 @@ Loader::InsertChildSheet(StyleSheet* aSh
   MOZ_ASSERT(aSheet, "Nothing to insert");
   MOZ_ASSERT(aParentSheet, "Need a parent to insert into");
   MOZ_ASSERT(aSheet->IsGecko() == !!aGeckoParentRule);
 
   // child sheets should always start out enabled, even if they got
   // cloned off of top-level sheets which were disabled
   aSheet->SetEnabled(true);
   if (aGeckoParentRule) {
-#ifdef MOZ_OLD_STYLE
-    aGeckoParentRule->SetSheet(aSheet->AsGecko()); // This sets the ownerRule on the sheet
-#else
     MOZ_CRASH("old style system disabled");
-#endif
   }
   aParentSheet->PrependStyleSheet(aSheet);
 
   LOG(("  Inserting into parent sheet"));
   return NS_OK;
 }
 
 /**
@@ -1674,60 +1663,19 @@ Loader::ParseSheet(const nsAString& aUTF
 {
   LOG(("css::Loader::ParseSheet"));
   NS_PRECONDITION(aLoadData, "Must have load data");
   NS_PRECONDITION(aLoadData->mSheet, "Must have sheet to parse into");
   aCompleted = false;
   if (ServoStyleSheet* sheet = aLoadData->mSheet->GetAsServo()) {
     return DoParseSheetServo(sheet, aUTF16, aUTF8, aLoadData, aAllowAsync, aCompleted);
   }
-#ifdef MOZ_OLD_STYLE
-  return DoParseSheetGecko(aLoadData->mSheet->AsGecko(), aUTF16, aUTF8, aLoadData, aCompleted);
-#else
     MOZ_CRASH("old style system disabled");
-#endif
 }
 
-#ifdef MOZ_OLD_STYLE
-nsresult
-Loader::DoParseSheetGecko(CSSStyleSheet* aSheet,
-                          const nsAString& aUTF16,
-                          Span<const uint8_t> aUTF8,
-                          SheetLoadData* aLoadData,
-                          bool& aCompleted)
-{
-  aLoadData->mIsBeingParsed = true;
-  nsCSSParser parser(this, aSheet);
-  nsresult rv = parser.ParseSheet(aUTF16,
-                                  aSheet->GetSheetURI(),
-                                  aSheet->GetBaseURI(),
-                                  aSheet->Principal(),
-                                  aLoadData,
-                                  aLoadData->mLineNumber);
-  aLoadData->mIsBeingParsed = false;
-  if (NS_FAILED(rv)) {
-    LOG_ERROR(("  Low-level error in parser!"));
-    SheetComplete(aLoadData, rv);
-    return rv;
-  }
-
-  NS_ASSERTION(aLoadData->mPendingChildren == 0 || !aLoadData->mSyncLoad,
-               "Sync load has leftover pending children!");
-
-  if (aLoadData->mPendingChildren == 0) {
-    LOG(("  No pending kids from parse"));
-    aCompleted = true;
-    SheetComplete(aLoadData, NS_OK);
-  }
-  // Otherwise, the children are holding strong refs to the data and
-  // will call SheetComplete() on it when they complete.
-
-  return NS_OK;
-}
-#endif
 
 nsresult
 Loader::DoParseSheetServo(ServoStyleSheet* aSheet,
                           const nsAString& aUTF16,
                           Span<const uint8_t> aUTF8,
                           SheetLoadData* aLoadData,
                           bool aAllowAsync,
                           bool& aCompleted)
@@ -2288,21 +2236,17 @@ Loader::LoadChildSheet(StyleSheet* aPare
   }
 
   // Now that we know it's safe to load this (passes security check and not a
   // loop) do so.
   RefPtr<StyleSheet> sheet;
   StyleSheetState state;
   if (aReusableSheets && aReusableSheets->FindReusableStyleSheet(aURL, sheet)) {
     if (aParentSheet->IsGecko()) {
-#ifdef MOZ_OLD_STYLE
-      aGeckoParentRule->SetSheet(sheet->AsGecko());
-#else
       MOZ_CRASH("old style system disabled");
-#endif
     }
     state = eSheetComplete;
   } else {
     bool isAlternate;
     const nsAString& empty = EmptyString();
     // For now, use CORS_NONE for child sheets
     rv = CreateSheet(aURL, nullptr, principal,
                      aParentSheet->ParsingMode(),
--- a/layout/style/Loader.h
+++ b/layout/style/Loader.h
@@ -585,23 +585,16 @@ private:
 
   //
   // Separate parsing paths for the old and new style systems, so that we can
   // make parsing asynchronous in the new style system without touching the old
   // one. Once we drop the old style system, this can be simplified.
   //
 
 
-#ifdef MOZ_OLD_STYLE
-  nsresult DoParseSheetGecko(CSSStyleSheet* aSheet,
-                             const nsAString& aUTF16,
-                             Span<const uint8_t> aUTF8,
-                             SheetLoadData* aLoadData,
-                             bool& aCompleted);
-#endif
 
   nsresult DoParseSheetServo(ServoStyleSheet* aSheet,
                              const nsAString& aUTF16,
                              Span<const uint8_t> aUTF8,
                              SheetLoadData* aLoadData,
                              bool aAllowAsync,
                              bool& aCompleted);
 
--- a/layout/style/MediaList.cpp
+++ b/layout/style/MediaList.cpp
@@ -8,19 +8,16 @@
 
 #include "mozilla/dom/MediaList.h"
 
 #include "mozAutoDocUpdate.h"
 #include "mozilla/dom/MediaListBinding.h"
 #include "mozilla/ServoMediaList.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "nsCSSParser.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsMediaList.h"
-#endif
 
 namespace mozilla {
 namespace dom {
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MediaList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
@@ -78,24 +75,17 @@ MediaList::Create(
     const nsAString& aMedia,
     CallerType aCallerType)
 {
   if (aBackendType == StyleBackendType::Servo) {
     RefPtr<ServoMediaList> mediaList = new ServoMediaList(aMedia, aCallerType);
     return mediaList.forget();
   }
 
-#ifdef MOZ_OLD_STYLE
-  nsCSSParser parser;
-  RefPtr<nsMediaList> mediaList = new nsMediaList();
-  parser.ParseMediaList(aMedia, nullptr, 0, mediaList, aCallerType);
-  return mediaList.forget();
-#else
   MOZ_CRASH("old style system disabled");
-#endif
 }
 
 void
 MediaList::GetMediaText(nsAString& aMediaText)
 {
   GetText(aMediaText);
 }
 
--- a/layout/style/RuleNodeCacheConditions.h
+++ b/layout/style/RuleNodeCacheConditions.h
@@ -8,166 +8,21 @@
  * an object that stores the result of determining whether a style struct that
  * was computed can be cached in the rule tree, and if so, what the conditions
  * it relies on are
  */
 
 #ifndef RuleNodeCacheConditions_h_
 #define RuleNodeCacheConditions_h_
 
-#ifdef MOZ_OLD_STYLE
-
-#include "mozilla/Attributes.h"
-#include "nsCoord.h"
-#include "nsTArray.h"
-
-class nsStyleContext;
-
-namespace mozilla {
-
-/**
- * nsRuleNodeCacheConditions is used to store information about whether
- * we can store a style struct that we're computing in the rule tree.
- *
- * For inherited structs (i.e., structs with inherited properties), we
- * cache the struct in the rule tree if it does not depend on any data
- * in the style context tree, and otherwise store it in the style
- * context tree.  This means that for inherited structs, setting any
- * conditions is equivalent to making the struct uncacheable.
- *
- * For reset structs (i.e., structs with non-inherited properties), we
- * are also able to cache structs in the rule tree conditionally on
- * certain common conditions.  For these structs, setting conditions
- * (SetFontSizeDependency, SetWritingModeDependency) instead causes the
- * struct to be stored, with the condition, in the rule tree.
- */
-class RuleNodeCacheConditions
-{
-public:
-  RuleNodeCacheConditions()
-    : mFontSize(0)
-    , mBits(0)
-    , mWritingMode(0)
-  {}
-
-  RuleNodeCacheConditions(const RuleNodeCacheConditions& aOther)
-    : mFontSize(aOther.mFontSize)
-    , mBits(aOther.mBits)
-    , mWritingMode(aOther.mWritingMode)
-  {}
-
-  RuleNodeCacheConditions& operator=(const RuleNodeCacheConditions& aOther)
-  {
-    mFontSize = aOther.mFontSize;
-    mBits = aOther.mBits;
-    mWritingMode = aOther.mWritingMode;
-    return *this;
-  }
-
-  bool operator==(const RuleNodeCacheConditions& aOther) const
-  {
-    return mFontSize == aOther.mFontSize &&
-           mBits == aOther.mBits &&
-           mWritingMode == aOther.mWritingMode;
-  }
-
-  bool operator!=(const RuleNodeCacheConditions& aOther) const
-  {
-    return !(*this == aOther);
-  }
-
-  bool Matches(nsStyleContext* aStyleContext) const;
-
-  /**
-   * Record that the data being computed depend on the font-size
-   * property of the element for which they are being computed.
-   *
-   * Note that we sometimes actually call this when there is a
-   * dependency on the font-size property of the parent element, but we
-   * only do so while computing inherited structs (nsStyleFont), and we
-   * only store reset structs conditionally.
-   */
-  void SetFontSizeDependency(nscoord aCoord)
-  {
-    MOZ_ASSERT(!(mBits & eHaveFontSize) || mFontSize == aCoord);
-    mFontSize = aCoord;
-    mBits |= eHaveFontSize;
-  }
-
-  /**
-   * Record that the data being computed depend on the writing mode of
-   * the element for which they are being computed, which in turn
-   * depends on its 'writing-mode', 'direction', and 'text-orientation'
-   * properties.
-   */
-  void SetWritingModeDependency(uint8_t aWritingMode)
-  {
-    MOZ_ASSERT(!(mBits & eHaveWritingMode) || mWritingMode == aWritingMode);
-    mWritingMode = aWritingMode;
-    mBits |= eHaveWritingMode;
-  }
-
-  void SetUncacheable()
-  {
-    mBits |= eUncacheable;
-  }
-
-  void Clear()
-  {
-    *this = RuleNodeCacheConditions();
-  }
-
-  bool Cacheable() const
-  {
-    return !(mBits & eUncacheable);
-  }
-
-  bool CacheableWithDependencies() const
-  {
-    return Cacheable() && mBits;
-  }
-
-  bool CacheableWithoutDependencies() const
-  {
-    // We're not uncacheable and we have don't have a font-size or
-    // writing mode value.
-    return mBits == 0;
-  }
-
-#ifdef DEBUG
-  void List() const;
-#endif
-
-private:
-  enum {
-    eUncacheable      = 1 << 0,
-    eHaveFontSize     = 1 << 1,
-    eHaveWritingMode  = 1 << 2,
-  };
-
-  // The font size from which em units are derived.
-  nscoord mFontSize;
-
-  // Values in mBits:
-  //   bit 0:      are we set to "uncacheable"?
-  //   bit 1:      do we have a font size value?
-  //   bit 2:      do we have a writing mode value?
-  uint8_t mBits;
-  uint8_t mWritingMode;
-};
-
-} // namespace mozilla
-
-#else
 
 namespace mozilla {
 
 // Define this dummy class so there are fewer call sites to change when the old
 // style system code is compiled out.
 class RuleNodeCacheConditions
 {
 };
 
 } // namespace mozilla
 
-#endif
 
 #endif // !defined(RuleNodeCacheConditions_h_)
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -14,20 +14,16 @@
 #include "nsAnimationManager.h"
 #include "nsAttrValueInlines.h"
 #include "nsCSSCounterStyleRule.h"
 #include "nsCSSFontFaceRule.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsCSSProps.h"
 #include "nsCSSParser.h"
 #include "nsCSSPseudoElements.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRuleProcessor.h"
-#include "nsCSSRules.h"
-#endif
 #include "nsContentUtils.h"
 #include "nsDOMTokenList.h"
 #include "nsDeviceContext.h"
 #include "nsIContentInlines.h"
 #include "nsICrashReporter.h"
 #include "nsIDOMNode.h"
 #include "nsIDocumentInlines.h"
 #include "nsILoadContext.h"
@@ -51,19 +47,16 @@
 #include "nsTArray.h"
 #include "nsTransitionManager.h"
 
 #include "mozilla/CORSMode.h"
 #include "mozilla/DeclarationBlockInlines.h"
 #include "mozilla/EffectCompositor.h"
 #include "mozilla/EffectSet.h"
 #include "mozilla/EventStates.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/GeckoStyleContext.h"
-#endif
 #include "mozilla/Keyframe.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ServoElementSnapshot.h"
 #include "mozilla/ServoRestyleManager.h"
 #include "mozilla/SizeOfState.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/SystemGroup.h"
@@ -2701,24 +2694,16 @@ Gecko_SetJemallocThreadLocalArena(bool e
   jemalloc_thread_local_arena(enabled);
 #endif
 }
 
 #include "nsStyleStructList.h"
 
 #undef STYLE_STRUCT
 
-#ifndef MOZ_STYLO
-#define SERVO_BINDING_FUNC(name_, return_, ...)                               \
-  return_ name_(__VA_ARGS__) {                                                \
-    MOZ_CRASH("stylo: shouldn't be calling " #name_ "in a non-stylo build");  \
-  }
-#include "ServoBindingList.h"
-#undef SERVO_BINDING_FUNC
-#endif
 
 ErrorReporter*
 Gecko_CreateCSSErrorReporter(ServoStyleSheet* sheet,
                              Loader* loader,
                              nsIURI* uri)
 {
   MOZ_ASSERT(NS_IsMainThread());
   return new ErrorReporter(sheet, loader, uri);
--- a/layout/style/ServoDocumentRule.cpp
+++ b/layout/style/ServoDocumentRule.cpp
@@ -37,27 +37,16 @@ ServoDocumentRule::Clone() const
 {
   // Rule::Clone is only used when CSSStyleSheetInner is cloned in
   // preparation of being mutated. However, ServoStyleSheet never clones
   // anything, so this method should never be called.
   MOZ_ASSERT_UNREACHABLE("Shouldn't be cloning ServoDocumentRule");
   return nullptr;
 }
 
-#ifdef MOZ_OLD_STYLE
-/* virtual */ bool
-ServoDocumentRule::UseForPresentation(nsPresContext* aPresContext,
-                                      nsMediaQueryResultCacheKey& aKey)
-{
-  // GroupRule::UseForPresentation is only used in nsCSSRuleProcessor,
-  // so this should never be called.
-  MOZ_ASSERT_UNREACHABLE("Shouldn't be calling UseForPresentation");
-  return false;
-}
-#endif
 
 #ifdef DEBUG
 /* virtual */ void
 ServoDocumentRule::List(FILE* out, int32_t aIndent) const
 {
   nsAutoCString str;
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
--- a/layout/style/ServoDocumentRule.h
+++ b/layout/style/ServoDocumentRule.h
@@ -18,20 +18,16 @@ class ServoDocumentRule final : public d
 {
 public:
   ServoDocumentRule(RefPtr<RawServoDocumentRule> aRawRule,
                     uint32_t aLine, uint32_t aColumn);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   already_AddRefed<css::Rule> Clone() const override;
-#ifdef MOZ_OLD_STYLE
-  bool UseForPresentation(nsPresContext* aPresContext,
-                          nsMediaQueryResultCacheKey& aKey) final;
-#endif
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoDocumentRule* Raw() const { return mRawRule; }
 
   // WebIDL interface
   void GetCssText(nsAString& aCssText) const final;
--- a/layout/style/ServoMediaRule.cpp
+++ b/layout/style/ServoMediaRule.cpp
@@ -54,27 +54,16 @@ ServoMediaRule::Clone() const
 {
   // Rule::Clone is only used when CSSStyleSheetInner is cloned in
   // preparation of being mutated. However, ServoStyleSheet never clones
   // anything, so this method should never be called.
   MOZ_ASSERT_UNREACHABLE("Shouldn't be cloning ServoMediaRule");
   return nullptr;
 }
 
-#ifdef MOZ_OLD_STYLE
-/* virtual */ bool
-ServoMediaRule::UseForPresentation(nsPresContext* aPresContext,
-                                   nsMediaQueryResultCacheKey& aKey)
-{
-  // GroupRule::UseForPresentation is only used in nsCSSRuleProcessor,
-  // so this should never be called.
-  MOZ_ASSERT_UNREACHABLE("Shouldn't be calling UseForPresentation");
-  return false;
-}
-#endif
 
 /* virtual */ void
 ServoMediaRule::SetStyleSheet(StyleSheet* aSheet)
 {
   if (mMediaList) {
     mMediaList->SetStyleSheet(aSheet);
   }
   CSSMediaRule::SetStyleSheet(aSheet);
--- a/layout/style/ServoMediaRule.h
+++ b/layout/style/ServoMediaRule.h
@@ -21,20 +21,16 @@ class ServoMediaRule final : public dom:
 public:
   ServoMediaRule(RefPtr<RawServoMediaRule> aRawRule,
                  uint32_t aLine, uint32_t aColumn);
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ServoMediaRule, dom::CSSMediaRule)
 
   already_AddRefed<css::Rule> Clone() const override;
-#ifdef MOZ_OLD_STYLE
-  bool UseForPresentation(nsPresContext* aPresContext,
-                          nsMediaQueryResultCacheKey& aKey) final;
-#endif
   void SetStyleSheet(StyleSheet* aSheet) override;
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoMediaRule* Raw() const { return mRawRule; }
 
   // WebIDL interface
--- a/layout/style/ServoStyleContext.cpp
+++ b/layout/style/ServoStyleContext.cpp
@@ -5,19 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ServoStyleContext.h"
 
 #include "nsCSSAnonBoxes.h"
 #include "nsStyleConsts.h"
 #include "nsStyleStruct.h"
 #include "nsPresContext.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsCSSRuleProcessor.h"
-#endif
 #include "mozilla/dom/HTMLBodyElement.h"
 
 #include "mozilla/ServoBindings.h"
 
 namespace mozilla {
 
 ServoStyleContext::ServoStyleContext(
     nsPresContext* aPresContext,
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -28,19 +28,16 @@
 #include "nsCSSPseudoElements.h"
 #include "nsDeviceContext.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsIDocumentInlines.h"
 #include "nsMediaFeatures.h"
 #include "nsPrintfCString.h"
 #include "nsSMILAnimationController.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleContext.h"
-#endif
 #include "nsXBLPrototypeBinding.h"
 #include "gfxUserFontSet.h"
 #include "nsBindingManager.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #ifdef DEBUG
--- a/layout/style/ServoSupportsRule.cpp
+++ b/layout/style/ServoSupportsRule.cpp
@@ -38,27 +38,16 @@ ServoSupportsRule::Clone() const
 {
   // Rule::Clone is only used when CSSStyleSheetInner is cloned in
   // preparation of being mutated. However, ServoStyleSheet never clones
   // anything, so this method should never be called.
   MOZ_ASSERT_UNREACHABLE("Shouldn't be cloning ServoSupportsRule");
   return nullptr;
 }
 
-#ifdef MOZ_OLD_STYLE
-/* virtual */ bool
-ServoSupportsRule::UseForPresentation(nsPresContext* aPresContext,
-                                      nsMediaQueryResultCacheKey& aKey)
-{
-  // GroupRule::UseForPresentation is only used in nsCSSRuleProcessor,
-  // so this should never be called.
-  MOZ_ASSERT_UNREACHABLE("Shouldn't be calling UseForPresentation");
-  return false;
-}
-#endif
 
 #ifdef DEBUG
 /* virtual */ void
 ServoSupportsRule::List(FILE* out, int32_t aIndent) const
 {
   nsAutoCString str;
   for (int32_t i = 0; i < aIndent; i++) {
     str.AppendLiteral("  ");
--- a/layout/style/ServoSupportsRule.h
+++ b/layout/style/ServoSupportsRule.h
@@ -18,20 +18,16 @@ class ServoSupportsRule final : public d
 {
 public:
   ServoSupportsRule(RefPtr<RawServoSupportsRule> aRawRule,
                     uint32_t aLine, uint32_t aColumn);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   already_AddRefed<css::Rule> Clone() const override;
-#ifdef MOZ_OLD_STYLE
-  bool UseForPresentation(nsPresContext* aPresContext,
-                          nsMediaQueryResultCacheKey& aKey) final;
-#endif
 #ifdef DEBUG
   void List(FILE* out = stdout, int32_t aIndent = 0) const final;
 #endif
 
   RawServoSupportsRule* Raw() const { return mRawRule; }
 
   // WebIDL interface
   void GetCssText(nsAString& aCssText) const final;
--- a/layout/style/ServoUtils.h
+++ b/layout/style/ServoUtils.h
@@ -30,50 +30,34 @@ inline bool IsInServoTraversal()
   // are generally unprepared to deal with non-Servo-but-also-non-main-thread
   // callers, and are likely to take the main-thread codepath if this function
   // returns false. So we assert against other non-main-thread callers here.
   MOZ_ASSERT(sInServoTraversal || NS_IsMainThread());
   return sInServoTraversal;
 }
 } // namespace mozilla
 
-#if defined(MOZ_STYLO) && defined(MOZ_OLD_STYLE)
-# define MOZ_DECL_STYLO_CHECK_METHODS \
-  bool IsGecko() const { return !IsServo(); } \
-  bool IsServo() const { return mType == StyleBackendType::Servo; }
-#elif defined(MOZ_STYLO)
 # define MOZ_DECL_STYLO_CHECK_METHODS \
   bool IsGecko() const { return false; } \
   bool IsServo() const { return true; }
-#else
-# define MOZ_DECL_STYLO_CHECK_METHODS \
-  bool IsGecko() const { return true; } \
-  bool IsServo() const { return false; }
-#endif
 
 #define MOZ_DECL_STYLO_CONVERT_METHODS_SERVO(servotype_) \
   inline servotype_* AsServo();                         \
   inline const servotype_* AsServo() const;             \
   inline servotype_* GetAsServo();                      \
   inline const servotype_* GetAsServo() const;
 
 #define MOZ_DECL_STYLO_CONVERT_METHODS_GECKO(geckotype_) \
   inline geckotype_* AsGecko();                         \
   inline const geckotype_* AsGecko() const;             \
   inline geckotype_* GetAsGecko();                      \
   inline const geckotype_* GetAsGecko() const;
 
-#ifdef MOZ_OLD_STYLE
-#define MOZ_DECL_STYLO_CONVERT_METHODS(geckotype_, servotype_) \
-  MOZ_DECL_STYLO_CONVERT_METHODS_SERVO(servotype_) \
-  MOZ_DECL_STYLO_CONVERT_METHODS_GECKO(geckotype_)
-#else
 #define MOZ_DECL_STYLO_CONVERT_METHODS(geckotype_, servotype_) \
   MOZ_DECL_STYLO_CONVERT_METHODS_SERVO(servotype_)
-#endif
 
 /**
  * Macro used in a base class of |geckotype_| and |servotype_|.
  * The class should define |StyleBackendType mType;| itself.
  */
 #define MOZ_DECL_STYLO_METHODS(geckotype_, servotype_)  \
   MOZ_DECL_STYLO_CHECK_METHODS                          \
   MOZ_DECL_STYLO_CONVERT_METHODS(geckotype_, servotype_)
@@ -111,47 +95,27 @@ inline bool IsInServoTraversal()
   }
 
 
 /**
  * Macro used in inline header of class |type_| with its Gecko and Servo
  * subclasses named |geckotype_| and |servotype_| correspondingly for
  * implementing the inline methods defined by MOZ_DECL_STYLO_METHODS.
  */
-#ifdef MOZ_OLD_STYLE
-#define MOZ_DEFINE_STYLO_METHODS(type_, geckotype_, servotype_) \
-  MOZ_DEFINE_STYLO_METHODS_SERVO(type_, servotype_) \
-  MOZ_DEFINE_STYLO_METHODS_GECKO(type_, geckotype_)
-#else
 #define MOZ_DEFINE_STYLO_METHODS(type_, geckotype_, servotype_) \
   MOZ_DEFINE_STYLO_METHODS_SERVO(type_, servotype_)
-#endif
 
 #define MOZ_STYLO_THIS_TYPE  mozilla::RemovePointer<decltype(this)>::Type
 #define MOZ_STYLO_GECKO_TYPE mozilla::RemovePointer<decltype(AsGecko())>::Type
 #define MOZ_STYLO_SERVO_TYPE mozilla::RemovePointer<decltype(AsServo())>::Type
 
 /**
  * Macro used to forward a method call to the concrete method defined by
  * the Servo or Gecko implementation. The class of the method using it
  * should use MOZ_DECL_STYLO_METHODS to define basic stylo methods.
  */
-#ifdef MOZ_OLD_STYLE
-#define MOZ_STYLO_FORWARD_CONCRETE(method_, geckoargs_, servoargs_)         \
-  static_assert(!mozilla::IsSame<decltype(&MOZ_STYLO_THIS_TYPE::method_),   \
-                                 decltype(&MOZ_STYLO_GECKO_TYPE::method_)>  \
-                ::value, "Gecko subclass should define its own " #method_); \
-  static_assert(!mozilla::IsSame<decltype(&MOZ_STYLO_THIS_TYPE::method_),   \
-                                 decltype(&MOZ_STYLO_SERVO_TYPE::method_)>  \
-                ::value, "Servo subclass should define its own " #method_); \
-  if (IsServo()) {                                                          \
-    return AsServo()->method_ servoargs_;                                   \
-  }                                                                         \
-  return AsGecko()->method_ geckoargs_;
-#else
 #define MOZ_STYLO_FORWARD_CONCRETE(method_, geckoargs_, servoargs_)         \
   return AsServo()->method_ servoargs_;
-#endif
 
 #define MOZ_STYLO_FORWARD(method_, args_) \
   MOZ_STYLO_FORWARD_CONCRETE(method_, args_, args_)
 
 #endif // mozilla_ServoUtils_h
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -13,32 +13,22 @@
 #include "mozilla/RuleNodeCacheConditions.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/StyleSetHandle.h"
 #include "mozilla/StyleSetHandleInlines.h"
 #include "mozilla/Tuple.h"
 #include "mozilla/UniquePtr.h"
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsIStyleRule.h"
-#include "mozilla/css/StyleRule.h"
-#endif
 #include "nsString.h"
 #include "nsStyleContext.h"
-#ifdef MOZ_OLD_STYLE
-#include "nsStyleSet.h"
-#endif
 #include "nsComputedDOMStyle.h"
 #include "nsContentUtils.h"
 #include "nsCSSParser.h"
 #include "nsCSSPseudoElements.h"
-#ifdef MOZ_OLD_STYLE
-#include "mozilla/css/Declaration.h"
-#endif
 #include "mozilla/dom/Element.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Likely.h"
 #include "mozilla/ServoBindings.h" // RawServoDeclarationBlock
 #include "mozilla/ServoCSSParser.h"
 #include "gfxMatrix.h"
 #include "gfxQuaternion.h"
 #include "nsIDocument.h"
@@ -48,157 +38,16 @@
 
 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.
- *
- * If there's no sensible common unit, this method returns eUnit_Null.
- *
- * @param   aFirstUnit One unit to resolve.
- * @param   aFirstUnit The other unit to resolve.
- * @return  A "common" unit that both source units can be converted into, or
- *          eUnit_Null if that's not possible.
- */
-static
-StyleAnimationValue::Unit
-GetCommonUnit(nsCSSPropertyID aProperty,
-              StyleAnimationValue::Unit aFirstUnit,
-              StyleAnimationValue::Unit aSecondUnit)
-{
-  if (aFirstUnit != aSecondUnit) {
-    if (nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_STORES_CALC) &&
-        (aFirstUnit == StyleAnimationValue::eUnit_Coord ||
-         aFirstUnit == StyleAnimationValue::eUnit_Percent ||
-         aFirstUnit == StyleAnimationValue::eUnit_Calc) &&
-        (aSecondUnit == StyleAnimationValue::eUnit_Coord ||
-         aSecondUnit == StyleAnimationValue::eUnit_Percent ||
-         aSecondUnit == StyleAnimationValue::eUnit_Calc)) {
-      // We can use calc() as the common unit.
-      return StyleAnimationValue::eUnit_Calc;
-    }
-    if ((aFirstUnit == StyleAnimationValue::eUnit_Color ||
-         aFirstUnit == StyleAnimationValue::eUnit_CurrentColor ||
-         aFirstUnit == StyleAnimationValue::eUnit_ComplexColor) &&
-        (aSecondUnit == StyleAnimationValue::eUnit_Color ||
-         aSecondUnit == StyleAnimationValue::eUnit_CurrentColor ||
-         aSecondUnit == StyleAnimationValue::eUnit_ComplexColor)) {
-      // We can use complex color as the common unit.
-      return StyleAnimationValue::eUnit_ComplexColor;
-    }
-    return StyleAnimationValue::eUnit_Null;
-  }
-  return aFirstUnit;
-}
-
-static
-nsCSSUnit
-GetCommonUnit(nsCSSPropertyID aProperty,
-              nsCSSUnit aFirstUnit,
-              nsCSSUnit aSecondUnit)
-{
-  if (aFirstUnit != aSecondUnit) {
-    if (nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_STORES_CALC) &&
-        (aFirstUnit == eCSSUnit_Pixel ||
-         aFirstUnit == eCSSUnit_Percent ||
-         aFirstUnit == eCSSUnit_Calc) &&
-        (aSecondUnit == eCSSUnit_Pixel ||
-         aSecondUnit == eCSSUnit_Percent ||
-         aSecondUnit == eCSSUnit_Calc)) {
-      // We can use calc() as the common unit.
-      return eCSSUnit_Calc;
-    }
-    return eCSSUnit_Null;
-  }
-  return aFirstUnit;
-}
-
-static nsCSSKeyword
-ToPrimitive(nsCSSKeyword aKeyword)
-{
-  switch (aKeyword) {
-    case eCSSKeyword_translatex:
-    case eCSSKeyword_translatey:
-    case eCSSKeyword_translatez:
-    case eCSSKeyword_translate:
-      return eCSSKeyword_translate3d;
-    case eCSSKeyword_scalex:
-    case eCSSKeyword_scaley:
-    case eCSSKeyword_scalez:
-    case eCSSKeyword_scale:
-      return eCSSKeyword_scale3d;
-    default:
-      return aKeyword;
-  }
-}
-
-static bool
-HasAccumulateMatrix(const nsCSSValueList* aList)
-{
-  const nsCSSValueList *item = aList;
-  do {
-    nsCSSKeyword func =
-      nsStyleTransformMatrix::TransformFunctionOf(item->mValue.GetArrayValue());
-    if (func == eCSSKeyword_accumulatematrix) {
-      return true;
-    }
-    item = item->mNext;
-  } while (item);