Bug 1062106 part 2 - Remove unused SVG Attribute Animations cascade level. r=birtles,dbaron
☠☠ backed out by 63cbef012e2a ☠ ☠
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Tue, 21 Mar 2017 15:43:26 +0900
changeset 399066 e77bfa57be613acfa77da4c3d28ac61c9ef83ba6
parent 399065 a565aca3013c5b7bb3d3c09ba09a26d0ca6bb781
child 399067 7682b2da0437cafe57b2358adf7400ce2d4b9ee7
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbirtles, dbaron
bugs1062106
milestone55.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 1062106 part 2 - Remove unused SVG Attribute Animations cascade level. r=birtles,dbaron 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/RestyleManager.cpp
layout/base/nsChangeHint.h
layout/style/SVGAttrAnimationRuleProcessor.cpp
layout/style/SVGAttrAnimationRuleProcessor.h
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
@@ -12363,22 +12357,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/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -403,18 +403,18 @@ RestyleManager::ContentStateChangedInter
 
 /* static */ nsCString
 RestyleManager::RestyleHintToString(nsRestyleHint aHint)
 {
   nsCString result;
   bool any = false;
   const char* names[] = {
     "Self", "SomeDescendants", "Subtree", "LaterSiblings", "CSSTransitions",
-    "CSSAnimations", "SVGAttrAnimations", "StyleAttribute",
-    "StyleAttribute_Animations", "Force", "ForceDescendants"
+    "CSSAnimations", "StyleAttribute", "StyleAttribute_Animations", "Force",
+    "ForceDescendants"
   };
   uint32_t hint = aHint & ((1 << ArrayLength(names)) - 1);
   uint32_t rest = aHint & ~((1 << ArrayLength(names)) - 1);
   for (uint32_t i = 0; i < ArrayLength(names); i++) {
     if (hint & (1 << i)) {
       if (any) {
         result.AppendLiteral(" | ");
       }
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -436,53 +436,45 @@ enum nsRestyleHint {
 
   // Replace the style data coming from CSS animations without updating
   // any other style data.  If a new style context results, update style
   // contexts on the descendants.  (Irrelevant if eRestyle_Self or
   // eRestyle_Subtree is also set, since those imply a superset of the
   // work.)
   eRestyle_CSSAnimations = 1 << 5,
 
-  // Replace the style data coming from SVG animations (SMIL Animations)
-  // without updating any other style data.  If a new style context
-  // results, update style contexts on the descendants.  (Irrelevant if
-  // eRestyle_Self or eRestyle_Subtree is also set, since those imply a
-  // superset of the work.)
-  eRestyle_SVGAttrAnimations = 1 << 6,
-
   // Replace the style data coming from inline style without updating
   // any other style data.  If a new style context results, update style
   // contexts on the descendants.  (Irrelevant if eRestyle_Self or
   // eRestyle_Subtree is also set, since those imply a superset of the
   // work.)  Supported only for element style contexts and not for
   // pseudo-elements or anonymous boxes, on which it converts to
   // eRestyle_Self.
   // If the change is for the advance of a declarative animation, use
   // the value below instead.
-  eRestyle_StyleAttribute = 1 << 7,
+  eRestyle_StyleAttribute = 1 << 6,
 
   // Same as eRestyle_StyleAttribute, but for when the change results
   // from the advance of a declarative animation.
-  eRestyle_StyleAttribute_Animations = 1 << 8,
+  eRestyle_StyleAttribute_Animations = 1 << 7,
 
   // Continue the restyling process to the current frame's children even
   // if this frame's restyling resulted in no style changes.
-  eRestyle_Force = 1 << 9,
+  eRestyle_Force = 1 << 8,
 
   // Continue the restyling process to all of the current frame's
   // descendants, even if any frame's restyling resulted in no style
   // 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,
+  eRestyle_ForceDescendants = 1 << 9,
 
   // 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/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();