Bug 1062106 part 2 - Remove unused SVG Attribute Animations cascade level. r?birtles, dbaron, xidorn draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Tue, 21 Mar 2017 15:43:26 +0900
changeset 503387 2fc18e9944c460bff121110585aece17fecbca63
parent 503386 b4a725377d46b53b24344d2536798fcbb35bbb48
child 503388 1bf8d2fdea14cc37c8eba70689eb217068daaaee
push id50563
push userbmo:mantaroh@gmail.com
push dateThu, 23 Mar 2017 05:52:17 +0000
reviewersbirtles, dbaron, xidorn
bugs1062106
milestone55.0a1
Bug 1062106 part 2 - Remove unused SVG Attribute Animations cascade level. r?birtles, dbaron, xidorn The previous patch in this series converted all uses of mapped attributes for animation to be animated as CSS properties (that is, to be treated as presentation hints in the cascade). As result, we no longer need the SVG Animation presentation hints level of the cascade, the corresponding rule processor(SVGAttrAnimationRuleProcessor), or the corresponding eRestyle_SVGAttrAnimations restyle hint. So this patch removes these unused rule processor and restyle hint. MozReview-Commit-ID: Hm8IDaqc3ym
devtools/client/performance/docs/markers.md
dom/base/nsDocument.cpp
dom/base/nsIDocument.h
layout/base/nsChangeHint.h
layout/style/SVGAttrAnimationRuleProcessor.cpp
layout/style/SVGAttrAnimationRuleProcessor.h
layout/style/ServoMediaRule.cpp
layout/style/SheetType.h
layout/style/moz.build
layout/style/nsStyleSet.cpp
--- a/devtools/client/performance/docs/markers.md
+++ b/devtools/client/performance/docs/markers.md
@@ -49,17 +49,16 @@ needs to figure out the computational st
   any amount of the following, separated via " | ". All future restyleHints
   are from `RestyleManager::RestyleHintToString`.
 
   * "eRestyle_Self"
   * "eRestyle_Subtree"
   * "eRestyle_LaterSiblings"
   * "eRestyle_CSSTransitions"
   * "eRestyle_CSSAnimations"
-  * "eRestyle_SVGAttrAnimations"
   * "eRestyle_StyleAttribute"
   * "eRestyle_StyleAttribute_Animations"
   * "eRestyle_Force"
   * "eRestyle_ForceDescendants"
 
 
 ## Javascript
 
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -183,17 +183,16 @@
 
 // FOR CSP (autogenerated by xpidl)
 #include "nsIContentSecurityPolicy.h"
 #include "mozilla/dom/nsCSPContext.h"
 #include "mozilla/dom/nsCSPService.h"
 #include "mozilla/dom/nsCSPUtils.h"
 #include "nsHTMLStyleSheet.h"
 #include "nsHTMLCSSStyleSheet.h"
-#include "SVGAttrAnimationRuleProcessor.h"
 #include "mozilla/dom/DOMImplementation.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/dom/Comment.h"
 #include "nsTextNode.h"
 #include "mozilla/dom/Link.h"
 #include "mozilla/dom/HTMLElementBinding.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/dom/Touch.h"
@@ -2296,21 +2295,16 @@ nsDocument::ResetStylesheetsToURI(nsIURI
   } else {
     mAttrStyleSheet = new nsHTMLStyleSheet(this);
   }
 
   if (!mStyleAttrStyleSheet) {
     mStyleAttrStyleSheet = new nsHTMLCSSStyleSheet();
   }
 
-  if (!mSVGAttrAnimationRuleProcessor) {
-    mSVGAttrAnimationRuleProcessor =
-      new mozilla::SVGAttrAnimationRuleProcessor();
-  }
-
   // Now set up our style sets
   nsCOMPtr<nsIPresShell> shell = GetShell();
   if (shell) {
     FillStyleSet(shell->StyleSet());
   }
 }
 
 static void
@@ -12360,22 +12354,16 @@ nsDocument::DocAddSizeOfExcludingThis(ns
     CSSLoader()->SizeOfIncludingThis(aWindowSizes->mMallocSizeOf);
 
   aWindowSizes->mDOMOtherSize +=
     mAttrStyleSheet ?
     mAttrStyleSheet->DOMSizeOfIncludingThis(aWindowSizes->mMallocSizeOf) :
     0;
 
   aWindowSizes->mDOMOtherSize +=
-    mSVGAttrAnimationRuleProcessor ?
-    mSVGAttrAnimationRuleProcessor->DOMSizeOfIncludingThis(
-                                      aWindowSizes->mMallocSizeOf) :
-    0;
-
-  aWindowSizes->mDOMOtherSize +=
     mStyledLinks.ShallowSizeOfExcludingThis(aWindowSizes->mMallocSizeOf);
 
   aWindowSizes->mDOMOtherSize +=
     mIdentifierMap.SizeOfExcludingThis(aWindowSizes->mMallocSizeOf);
 
   // Measurement of the following members may be added later if DMD finds it
   // is worthwhile:
   // - many!
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -104,17 +104,16 @@ struct nsCSSSelectorList;
 
 namespace mozilla {
 class AbstractThread;
 class CSSStyleSheet;
 class ErrorResult;
 class EventStates;
 class PendingAnimationTracker;
 class StyleSetHandle;
-class SVGAttrAnimationRuleProcessor;
 template<typename> class OwningNonNull;
 
 namespace css {
 class Loader;
 class ImageLoader;
 class Rule;
 } // namespace css
 
@@ -1277,26 +1276,16 @@ public:
   /**
    * Get this document's inline style sheet.  May return null if there
    * isn't one
    */
   nsHTMLCSSStyleSheet* GetInlineStyleSheet() const {
     return mStyleAttrStyleSheet;
   }
 
-  /**
-   * Get this document's SVG Animation rule processor.  May return null
-   * if there isn't one.
-   */
-  mozilla::SVGAttrAnimationRuleProcessor*
-  GetSVGAttrAnimationRuleProcessor() const
-  {
-    return mSVGAttrAnimationRuleProcessor;
-  }
-
   virtual void SetScriptGlobalObject(nsIScriptGlobalObject* aGlobalObject) = 0;
 
   /**
    * Get/set the object from which the context for the event/script handling can
    * be got. Normally GetScriptHandlingObject() returns the same object as
    * GetScriptGlobalObject(), but if the document is loaded as data,
    * non-null may be returned, even if GetScriptGlobalObject() returns null.
    * aHasHadScriptHandlingObject is set true if document has had the object
@@ -3017,17 +3006,16 @@ protected:
 
   // This is a weak reference, but we hold a strong reference to mNodeInfo,
   // which in turn holds a strong reference to this mNodeInfoManager.
   nsNodeInfoManager* mNodeInfoManager;
   RefPtr<mozilla::css::Loader> mCSSLoader;
   RefPtr<mozilla::css::ImageLoader> mStyleImageLoader;
   RefPtr<nsHTMLStyleSheet> mAttrStyleSheet;
   RefPtr<nsHTMLCSSStyleSheet> mStyleAttrStyleSheet;
-  RefPtr<mozilla::SVGAttrAnimationRuleProcessor> mSVGAttrAnimationRuleProcessor;
 
   // Tracking for images in the document.
   RefPtr<mozilla::dom::ImageTracker> mImageTracker;
 
   // The set of all object, embed, applet, video/audio elements or
   // nsIObjectLoadingContent or nsIDocumentActivity for which this is the
   // owner document. (They might not be in the document.)
   // These are non-owning pointers, the elements are responsible for removing
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -538,17 +538,16 @@ enum nsRestyleHint {
   // changes.  (Implies eRestyle_Force.)  Note that this is weaker than
   // eRestyle_Subtree, which makes us rerun selector matching on all
   // descendants rather than just continuing the restyling process.
   eRestyle_ForceDescendants = 1 << 10,
 
   // Useful unions:
   eRestyle_AllHintsWithAnimations = eRestyle_CSSTransitions |
                                     eRestyle_CSSAnimations |
-                                    eRestyle_SVGAttrAnimations |
                                     eRestyle_StyleAttribute_Animations,
 };
 
 // The functions below need an integral type to cast to to avoid
 // infinite recursion.
 typedef decltype(nsRestyleHint(0) + nsRestyleHint(0)) nsRestyleHint_size_t;
 
 inline constexpr nsRestyleHint operator|(nsRestyleHint aLeft,
deleted file mode 100644
--- a/layout/style/SVGAttrAnimationRuleProcessor.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * 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/.
- */
-
-/*
- * style rule processor for rules from SMIL Animation of SVG mapped
- * attributes (attributes whose values are mapped into style)
- */
-
-#include "SVGAttrAnimationRuleProcessor.h"
-#include "nsRuleProcessorData.h"
-#include "nsSVGElement.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-SVGAttrAnimationRuleProcessor::SVGAttrAnimationRuleProcessor()
-{
-}
-
-SVGAttrAnimationRuleProcessor::~SVGAttrAnimationRuleProcessor()
-{
-}
-
-NS_IMPL_ISUPPORTS(SVGAttrAnimationRuleProcessor, nsIStyleRuleProcessor)
-
-/* virtual */ void
-SVGAttrAnimationRuleProcessor::RulesMatching(ElementRuleProcessorData* aData)
-{
-  ElementRulesMatching(aData->mElement, aData->mRuleWalker);
-}
-
-void
-SVGAttrAnimationRuleProcessor::ElementRulesMatching(Element* aElement,
-                                                    nsRuleWalker* aRuleWalker)
-{
-  if (aElement->IsSVGElement()) {
-    static_cast<nsSVGElement*>(aElement)->
-      WalkAnimatedContentStyleRules(aRuleWalker);
-  }
-}
-
-/* virtual */ nsRestyleHint
-SVGAttrAnimationRuleProcessor::HasStateDependentStyle(StateRuleProcessorData* aData)
-{
-  return nsRestyleHint(0);
-}
-
-/* virtual */ nsRestyleHint
-SVGAttrAnimationRuleProcessor::HasStateDependentStyle(PseudoElementStateRuleProcessorData* aData)
-{
-  return nsRestyleHint(0);
-}
-
-/* virtual */ bool
-SVGAttrAnimationRuleProcessor::HasDocumentStateDependentStyle(StateRuleProcessorData* aData)
-{
-  return false;
-}
-
-/* virtual */ nsRestyleHint
-SVGAttrAnimationRuleProcessor::HasAttributeDependentStyle(
-    AttributeRuleProcessorData* aData,
-    RestyleHintData& aRestyleHintDataResult)
-{
-  return nsRestyleHint(0);
-}
-
-/* virtual */ bool
-SVGAttrAnimationRuleProcessor::MediumFeaturesChanged(nsPresContext* aPresContext)
-{
-  return false;
-}
-
-/* virtual */ void
-SVGAttrAnimationRuleProcessor::RulesMatching(PseudoElementRuleProcessorData* aData)
-{
-  // If SMIL Animation of SVG attributes can ever target
-  // pseudo-elements, we need to adjust either
-  // nsStyleSet::RuleNodeWithReplacement or the test in
-  // ElementRestyler::RestyleSelf (added in bug 977991 patch 4) to
-  // handle such styles.
-}
-
-/* virtual */ void
-SVGAttrAnimationRuleProcessor::RulesMatching(AnonBoxRuleProcessorData* aData)
-{
-  // If SMIL Animation of SVG attributes can ever target anonymous boxes,
-  // see comment in RulesMatching(PseudoElementRuleProcessorData*).
-}
-
-#ifdef MOZ_XUL
-/* virtual */ void
-SVGAttrAnimationRuleProcessor::RulesMatching(XULTreeRuleProcessorData* aData)
-{
-  // If SMIL Animation of SVG attributes can ever target XUL tree pseudos,
-  // see comment in RulesMatching(PseudoElementRuleProcessorData*).
-}
-#endif
-
-/* virtual */ size_t
-SVGAttrAnimationRuleProcessor::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
-{
-  return 0; // SVGAttrAnimationRuleProcessors are charged to the DOM, not layout
-}
-
-/* virtual */ size_t
-SVGAttrAnimationRuleProcessor::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
-{
-  return 0; // SVGAttrAnimationRuleProcessors are charged to the DOM, not layout
-}
-
-size_t
-SVGAttrAnimationRuleProcessor::DOMSizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
-{
-  size_t n = aMallocSizeOf(this);
-
-  return n;
-}
deleted file mode 100644
--- a/layout/style/SVGAttrAnimationRuleProcessor.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * 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/. */
-
-/*
- * style rule processor for rules from SMIL Animation of SVG mapped
- * attributes (attributes whose values are mapped into style)
- */
-
-#ifndef mozilla_SVGAttrAnimationRuleProcessor_h_
-#define mozilla_SVGAttrAnimationRuleProcessor_h_
-
-#include "nsIStyleRuleProcessor.h"
-
-class nsRuleWalker;
-
-namespace mozilla {
-
-namespace dom {
-class Element;
-} // namespace dom
-
-class SVGAttrAnimationRuleProcessor final : public nsIStyleRuleProcessor
-{
-public:
-  SVGAttrAnimationRuleProcessor();
-
-private:
-  ~SVGAttrAnimationRuleProcessor();
-
-public:
-  NS_DECL_ISUPPORTS
-
-  // nsIStyleRuleProcessor API
-  virtual void RulesMatching(ElementRuleProcessorData* aData) override;
-  virtual void RulesMatching(PseudoElementRuleProcessorData* aData) override;
-  virtual void RulesMatching(AnonBoxRuleProcessorData* aData) override;
-#ifdef MOZ_XUL
-  virtual void RulesMatching(XULTreeRuleProcessorData* aData) override;
-#endif
-  virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData) override;
-  virtual nsRestyleHint HasStateDependentStyle(PseudoElementStateRuleProcessorData* aData) override;
-  virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) override;
-  virtual nsRestyleHint
-    HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
-                               RestyleHintData& aRestyleHintDataResult) override;
-  virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) override;
-  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
-    const MOZ_MUST_OVERRIDE override;
-  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
-    const MOZ_MUST_OVERRIDE override;
-
-  size_t DOMSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
-
-  // A shortcut for nsStyleSet to call RulesMatching with less setup.
-  void ElementRulesMatching(mozilla::dom::Element* aElement,
-                            nsRuleWalker* aRuleWalker);
-
-private:
-  SVGAttrAnimationRuleProcessor(const SVGAttrAnimationRuleProcessor& aCopy) = delete;
-  SVGAttrAnimationRuleProcessor& operator=(const SVGAttrAnimationRuleProcessor& aCopy) = delete;
-};
-
-} // namespace mozilla
-
-#endif /* !defined(mozilla_SVGAttrAnimationRuleProcessor_h_) */
--- a/layout/style/ServoMediaRule.cpp
+++ b/layout/style/ServoMediaRule.cpp
@@ -4,16 +4,17 @@
  * 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/. */
 
 /* representation of CSSMediaRule for stylo */
 
 #include "mozilla/ServoMediaRule.h"
 
 #include "mozilla/ServoBindings.h"
+#include "mozilla/ServoMediaList.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 ServoMediaRule::ServoMediaRule(RefPtr<RawServoMediaRule> aRawRule)
   : CSSMediaRule(Servo_MediaRule_GetRules(aRawRule).Consume())
   , mRawRule(Move(aRawRule))
--- a/layout/style/SheetType.h
+++ b/layout/style/SheetType.h
@@ -16,17 +16,16 @@ namespace mozilla {
 // highest (for non-!important rules).
 //
 // Be sure to update NS_RULE_NODE_LEVEL_MASK when changing the number
 // of sheet types; static assertions enforce this.
 enum class SheetType : uint8_t {
   Agent, // CSS
   User, // CSS
   PresHint,
-  SVGAttrAnimation,
   Doc, // CSS
   ScopedDoc,
   StyleAttr,
   Override, // CSS
   Animation,
   Transition,
 
   Count,
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -223,17 +223,16 @@ UNIFIED_SOURCES += [
     'ServoNamespaceRule.cpp',
     'ServoSpecifiedValues.cpp',
     'ServoStyleRule.cpp',
     'ServoStyleSet.cpp',
     'ServoStyleSheet.cpp',
     'StyleAnimationValue.cpp',
     'StyleRule.cpp',
     'StyleSheet.cpp',
-    'SVGAttrAnimationRuleProcessor.cpp',
 ]
 
 # - nsCSSRuleProcessor.cpp needs to be built separately because it uses
 # plarena.h.
 # - nsLayoutStylesheetCache.cpp needs to be built separately because it uses
 # nsExceptionHandler.h, which includes windows.h.
 SOURCES += [
     'nsCSSRuleProcessor.cpp',
--- a/layout/style/nsStyleSet.cpp
+++ b/layout/style/nsStyleSet.cpp
@@ -31,17 +31,16 @@
 #include "nsRuleData.h"
 #include "nsRuleProcessorData.h"
 #include "nsAnimationManager.h"
 #include "nsStyleSheetService.h"
 #include "mozilla/dom/Element.h"
 #include "GeckoProfiler.h"
 #include "nsHTMLCSSStyleSheet.h"
 #include "nsHTMLStyleSheet.h"
-#include "SVGAttrAnimationRuleProcessor.h"
 #include "nsCSSRules.h"
 #include "nsPrintfCString.h"
 #include "nsIFrame.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/RestyleManagerInlines.h"
 #include "nsQueryObject.h"
 
 #include <inttypes.h>
@@ -288,17 +287,16 @@ nsStyleSet::Init(nsPresContext *aPresCon
   mDisableTextZoomStyleRule = new nsDisableTextZoomStyleRule;
 
   mRuleTree = nsRuleNode::CreateRootNode(aPresContext);
 
   // Make an explicit GatherRuleProcessors call for the levels that
   // don't have style sheets.  The other levels will have their calls
   // triggered by DirtyRuleProcessors.
   GatherRuleProcessors(SheetType::PresHint);
-  GatherRuleProcessors(SheetType::SVGAttrAnimation);
   GatherRuleProcessors(SheetType::StyleAttr);
   GatherRuleProcessors(SheetType::Animation);
   GatherRuleProcessors(SheetType::Transition);
 }
 
 nsresult
 nsStyleSet::BeginReconstruct()
 {
@@ -473,21 +471,16 @@ nsStyleSet::GatherRuleProcessors(SheetTy
       MOZ_ASSERT(mSheets[aType].IsEmpty());
       mRuleProcessors[aType] = PresContext()->Document()->GetInlineStyleSheet();
       return NS_OK;
     case SheetType::PresHint:
       MOZ_ASSERT(mSheets[aType].IsEmpty());
       mRuleProcessors[aType] =
         PresContext()->Document()->GetAttributeStyleSheet();
       return NS_OK;
-    case SheetType::SVGAttrAnimation:
-      MOZ_ASSERT(mSheets[aType].IsEmpty());
-      mRuleProcessors[aType] =
-        PresContext()->Document()->GetSVGAttrAnimationRuleProcessor();
-      return NS_OK;
     default:
       // keep going
       break;
   }
   MOZ_ASSERT(IsCSSSheetType(aType));
   if (aType == SheetType::ScopedDoc) {
     // Create a rule processor for each scope.
     uint32_t count = mSheets[SheetType::ScopedDoc].Length();
@@ -1110,17 +1103,16 @@ nsStyleSet::FileRules(nsIStyleRuleProces
 
   NS_ASSERTION(mBatching == 0, "rule processors out of date");
 
   // Cascading order:
   // [least important]
   //  - UA normal rules                    = Agent        normal
   //  - User normal rules                  = User         normal
   //  - Presentation hints                 = PresHint     normal
-  //  - SVG Animation (highest pres hint)  = SVGAttrAnimation normal
   //  - Author normal rules                = Document     normal
   //  - Override normal rules              = Override     normal
   //  - animation rules                    = Animation    normal
   //  - Author !important rules            = Document     !important
   //  - Override !important rules          = Override     !important
   //  - User !important rules              = User         !important
   //  - UA !important rules                = Agent        !important
   //  - transition rules                   = Transition   normal
@@ -1142,21 +1134,17 @@ nsStyleSet::FileRules(nsIStyleRuleProces
   if (!skipUserStyles && mRuleProcessors[SheetType::User]) // NOTE: different
     (*aCollectorFunc)(mRuleProcessors[SheetType::User], aData);
   nsRuleNode* lastUserRN = aRuleWalker->CurrentNode();
   bool haveImportantUserRules = !aRuleWalker->GetCheckForImportantRules();
 
   aRuleWalker->SetLevel(SheetType::PresHint, false, false);
   if (mRuleProcessors[SheetType::PresHint])
     (*aCollectorFunc)(mRuleProcessors[SheetType::PresHint], aData);
-
-  aRuleWalker->SetLevel(SheetType::SVGAttrAnimation, false, false);
-  if (mRuleProcessors[SheetType::SVGAttrAnimation])
-    (*aCollectorFunc)(mRuleProcessors[SheetType::SVGAttrAnimation], aData);
-  nsRuleNode* lastSVGAttrAnimationRN = aRuleWalker->CurrentNode();
+  nsRuleNode* lastPresHintRN = aRuleWalker->CurrentNode();
 
   aRuleWalker->SetLevel(SheetType::Doc, false, true);
   bool cutOffInheritance = false;
   if (mBindingManager && aElement) {
     // We can supply additional document-level sheets that should be walked.
     mBindingManager->WalkRules(aCollectorFunc,
                                static_cast<ElementDependentRuleProcessorData*>(aData),
                                &cutOffInheritance);
@@ -1220,21 +1208,21 @@ nsStyleSet::FileRules(nsIStyleRuleProces
 #ifdef DEBUG
   else {
     AssertNoImportantRules(lastScopedRN, lastDocRN);
   }
 #endif
 
   if (haveImportantDocRules) {
     aRuleWalker->SetLevel(SheetType::Doc, true, false);
-    AddImportantRules(lastDocRN, lastSVGAttrAnimationRN, aRuleWalker);  // doc
+    AddImportantRules(lastDocRN, lastPresHintRN, aRuleWalker);  // doc
   }
 #ifdef DEBUG
   else {
-    AssertNoImportantRules(lastDocRN, lastSVGAttrAnimationRN);
+    AssertNoImportantRules(lastDocRN, lastPresHintRN);
   }
 #endif
 
   if (haveImportantStyleAttrRules) {
     aRuleWalker->SetLevel(SheetType::StyleAttr, true, false);
     AddImportantRules(lastStyleAttrRN, lastScopedRN, aRuleWalker);  // style attr
   }
 #ifdef DEBUG
@@ -1249,17 +1237,17 @@ nsStyleSet::FileRules(nsIStyleRuleProces
   }
 #ifdef DEBUG
   else {
     AssertNoImportantRules(lastOvrRN, lastStyleAttrRN);
   }
 #endif
 
 #ifdef DEBUG
-  AssertNoCSSRules(lastSVGAttrAnimationRN, lastUserRN);
+  AssertNoCSSRules(lastPresHintRN, lastUserRN);
 #endif
 
   if (haveImportantUserRules) {
     aRuleWalker->SetLevel(SheetType::User, true, false);
     AddImportantRules(lastUserRN, lastAgentRN, aRuleWalker); //user
   }
 #ifdef DEBUG
   else {
@@ -1306,19 +1294,16 @@ nsStyleSet::WalkRuleProcessors(nsIStyleR
 
   bool skipUserStyles = aData->mElement->IsInNativeAnonymousSubtree();
   if (!skipUserStyles && mRuleProcessors[SheetType::User]) // NOTE: different
     (*aFunc)(mRuleProcessors[SheetType::User], aData);
 
   if (mRuleProcessors[SheetType::PresHint])
     (*aFunc)(mRuleProcessors[SheetType::PresHint], aData);
 
-  if (mRuleProcessors[SheetType::SVGAttrAnimation])
-    (*aFunc)(mRuleProcessors[SheetType::SVGAttrAnimation], aData);
-
   bool cutOffInheritance = false;
   if (mBindingManager) {
     // We can supply additional document-level sheets that should be walked.
     if (aWalkAllXBLStylesheets) {
       mBindingManager->WalkAllRules(aFunc, aData);
     } else {
       mBindingManager->WalkRules(aFunc, aData, &cutOffInheritance);
     }
@@ -1492,17 +1477,16 @@ struct CascadeLevel {
   bool mCheckForImportantRules;
   nsRestyleHint mLevelReplacementHint;
 };
 
 static const CascadeLevel gCascadeLevels[] = {
   { SheetType::Agent,            false, false, nsRestyleHint(0) },
   { SheetType::User,             false, false, nsRestyleHint(0) },
   { SheetType::PresHint,         false, false, nsRestyleHint(0) },
-  { SheetType::SVGAttrAnimation, false, false, eRestyle_SVGAttrAnimations },
   { SheetType::Doc,              false, false, nsRestyleHint(0) },
   { SheetType::ScopedDoc,        false, false, nsRestyleHint(0) },
   { SheetType::StyleAttr,        false, true,  eRestyle_StyleAttribute |
                                                eRestyle_StyleAttribute_Animations },
   { SheetType::Override,         false, false, nsRestyleHint(0) },
   { SheetType::Animation,        false, false, eRestyle_CSSAnimations },
   { SheetType::ScopedDoc,        true,  false, nsRestyleHint(0) },
   { SheetType::Doc,              true,  false, nsRestyleHint(0) },
@@ -1530,17 +1514,16 @@ nsStyleSet::RuleNodeWithReplacement(Elem
              "should have aPseudoElement only for certain pseudo elements");
 
   // Remove the Force bits, which we don't need and which could confuse
   // the remainingReplacements code below.
   aReplacements &= ~(eRestyle_Force | eRestyle_ForceDescendants);
 
   MOZ_ASSERT(!(aReplacements & ~(eRestyle_CSSTransitions |
                                  eRestyle_CSSAnimations |
-                                 eRestyle_SVGAttrAnimations |
                                  eRestyle_StyleAttribute |
                                  eRestyle_StyleAttribute_Animations)),
              "unexpected replacement bits");
 
   // This array can be hot and often grows to ~20 elements, so inline storage
   // is best.
   AutoTArray<RuleNodeInfo, 30> rules;
 
@@ -1650,26 +1633,16 @@ nsStyleSet::RuleNodeWithReplacement(Elem
                                nullptr);
             if (rule) {
               ruleWalker.ForwardOnPossiblyCSSRule(rule);
               ruleWalker.CurrentNode()->SetIsAnimationRule();
             }
           }
           break;
         }
-        case SheetType::SVGAttrAnimation: {
-          SVGAttrAnimationRuleProcessor* ruleProcessor =
-            static_cast<SVGAttrAnimationRuleProcessor*>(
-              mRuleProcessors[SheetType::SVGAttrAnimation].get());
-          if (ruleProcessor &&
-              aPseudoType == CSSPseudoElementType::NotPseudo) {
-            ruleProcessor->ElementRulesMatching(aElement, &ruleWalker);
-          }
-          break;
-        }
         case SheetType::StyleAttr: {
           if (!level->mIsImportant) {
             // First time through, we handle the non-!important rule.
             nsHTMLCSSStyleSheet* ruleProcessor =
               static_cast<nsHTMLCSSStyleSheet*>(
                 mRuleProcessors[SheetType::StyleAttr].get());
             if (ruleProcessor) {
               lastScopedRN = ruleWalker.CurrentNode();