SVGAttrAnimationRuleProcessor.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. /*
  7. * style rule processor for rules from SMIL Animation of SVG mapped
  8. * attributes (attributes whose values are mapped into style)
  9. */
  10. #ifndef mozilla_SVGAttrAnimationRuleProcessor_h_
  11. #define mozilla_SVGAttrAnimationRuleProcessor_h_
  12. #include "nsIStyleRuleProcessor.h"
  13. class nsRuleWalker;
  14. namespace mozilla {
  15. namespace dom {
  16. class Element;
  17. } // namespace dom
  18. class SVGAttrAnimationRuleProcessor final : public nsIStyleRuleProcessor
  19. {
  20. public:
  21. SVGAttrAnimationRuleProcessor();
  22. private:
  23. ~SVGAttrAnimationRuleProcessor();
  24. public:
  25. NS_DECL_ISUPPORTS
  26. // nsIStyleRuleProcessor API
  27. virtual void RulesMatching(ElementRuleProcessorData* aData) override;
  28. virtual void RulesMatching(PseudoElementRuleProcessorData* aData) override;
  29. virtual void RulesMatching(AnonBoxRuleProcessorData* aData) override;
  30. #ifdef MOZ_XUL
  31. virtual void RulesMatching(XULTreeRuleProcessorData* aData) override;
  32. #endif
  33. virtual nsRestyleHint HasStateDependentStyle(StateRuleProcessorData* aData) override;
  34. virtual nsRestyleHint HasStateDependentStyle(PseudoElementStateRuleProcessorData* aData) override;
  35. virtual bool HasDocumentStateDependentStyle(StateRuleProcessorData* aData) override;
  36. virtual nsRestyleHint
  37. HasAttributeDependentStyle(AttributeRuleProcessorData* aData,
  38. RestyleHintData& aRestyleHintDataResult) override;
  39. virtual bool MediumFeaturesChanged(nsPresContext* aPresContext) override;
  40. virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf)
  41. const MOZ_MUST_OVERRIDE override;
  42. virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
  43. const MOZ_MUST_OVERRIDE override;
  44. size_t DOMSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
  45. // A shortcut for nsStyleSet to call RulesMatching with less setup.
  46. void ElementRulesMatching(mozilla::dom::Element* aElement,
  47. nsRuleWalker* aRuleWalker);
  48. private:
  49. SVGAttrAnimationRuleProcessor(const SVGAttrAnimationRuleProcessor& aCopy) = delete;
  50. SVGAttrAnimationRuleProcessor& operator=(const SVGAttrAnimationRuleProcessor& aCopy) = delete;
  51. };
  52. } // namespace mozilla
  53. #endif /* !defined(mozilla_SVGAttrAnimationRuleProcessor_h_) */