SVGAttrAnimationRuleProcessor.cpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. /*
  8. * style rule processor for rules from SMIL Animation of SVG mapped
  9. * attributes (attributes whose values are mapped into style)
  10. */
  11. #include "SVGAttrAnimationRuleProcessor.h"
  12. #include "nsRuleProcessorData.h"
  13. #include "nsSVGElement.h"
  14. using namespace mozilla;
  15. using namespace mozilla::dom;
  16. SVGAttrAnimationRuleProcessor::SVGAttrAnimationRuleProcessor()
  17. {
  18. }
  19. SVGAttrAnimationRuleProcessor::~SVGAttrAnimationRuleProcessor()
  20. {
  21. }
  22. NS_IMPL_ISUPPORTS(SVGAttrAnimationRuleProcessor, nsIStyleRuleProcessor)
  23. /* virtual */ void
  24. SVGAttrAnimationRuleProcessor::RulesMatching(ElementRuleProcessorData* aData)
  25. {
  26. ElementRulesMatching(aData->mElement, aData->mRuleWalker);
  27. }
  28. void
  29. SVGAttrAnimationRuleProcessor::ElementRulesMatching(Element* aElement,
  30. nsRuleWalker* aRuleWalker)
  31. {
  32. if (aElement->IsSVGElement()) {
  33. static_cast<nsSVGElement*>(aElement)->
  34. WalkAnimatedContentStyleRules(aRuleWalker);
  35. }
  36. }
  37. /* virtual */ nsRestyleHint
  38. SVGAttrAnimationRuleProcessor::HasStateDependentStyle(StateRuleProcessorData* aData)
  39. {
  40. return nsRestyleHint(0);
  41. }
  42. /* virtual */ nsRestyleHint
  43. SVGAttrAnimationRuleProcessor::HasStateDependentStyle(PseudoElementStateRuleProcessorData* aData)
  44. {
  45. return nsRestyleHint(0);
  46. }
  47. /* virtual */ bool
  48. SVGAttrAnimationRuleProcessor::HasDocumentStateDependentStyle(StateRuleProcessorData* aData)
  49. {
  50. return false;
  51. }
  52. /* virtual */ nsRestyleHint
  53. SVGAttrAnimationRuleProcessor::HasAttributeDependentStyle(
  54. AttributeRuleProcessorData* aData,
  55. RestyleHintData& aRestyleHintDataResult)
  56. {
  57. return nsRestyleHint(0);
  58. }
  59. /* virtual */ bool
  60. SVGAttrAnimationRuleProcessor::MediumFeaturesChanged(nsPresContext* aPresContext)
  61. {
  62. return false;
  63. }
  64. /* virtual */ void
  65. SVGAttrAnimationRuleProcessor::RulesMatching(PseudoElementRuleProcessorData* aData)
  66. {
  67. // If SMIL Animation of SVG attributes can ever target
  68. // pseudo-elements, we need to adjust either
  69. // nsStyleSet::RuleNodeWithReplacement or the test in
  70. // ElementRestyler::RestyleSelf (added in bug 977991 patch 4) to
  71. // handle such styles.
  72. }
  73. /* virtual */ void
  74. SVGAttrAnimationRuleProcessor::RulesMatching(AnonBoxRuleProcessorData* aData)
  75. {
  76. // If SMIL Animation of SVG attributes can ever target anonymous boxes,
  77. // see comment in RulesMatching(PseudoElementRuleProcessorData*).
  78. }
  79. #ifdef MOZ_XUL
  80. /* virtual */ void
  81. SVGAttrAnimationRuleProcessor::RulesMatching(XULTreeRuleProcessorData* aData)
  82. {
  83. // If SMIL Animation of SVG attributes can ever target XUL tree pseudos,
  84. // see comment in RulesMatching(PseudoElementRuleProcessorData*).
  85. }
  86. #endif
  87. /* virtual */ size_t
  88. SVGAttrAnimationRuleProcessor::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
  89. {
  90. return 0; // SVGAttrAnimationRuleProcessors are charged to the DOM, not layout
  91. }
  92. /* virtual */ size_t
  93. SVGAttrAnimationRuleProcessor::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
  94. {
  95. return 0; // SVGAttrAnimationRuleProcessors are charged to the DOM, not layout
  96. }
  97. size_t
  98. SVGAttrAnimationRuleProcessor::DOMSizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
  99. {
  100. size_t n = aMallocSizeOf(this);
  101. return n;
  102. }