1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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/.
9 * style rule processor for rules from SMIL Animation of SVG mapped
10 * attributes (attributes whose values are mapped into style)
13 #include "SVGAttrAnimationRuleProcessor.h"
14 #include "nsRuleProcessorData.h"
15 #include "nsSVGElement.h"
17 using namespace mozilla
;
18 using namespace mozilla::dom
;
20 SVGAttrAnimationRuleProcessor::SVGAttrAnimationRuleProcessor()
24 SVGAttrAnimationRuleProcessor::~SVGAttrAnimationRuleProcessor()
28 NS_IMPL_ISUPPORTS(SVGAttrAnimationRuleProcessor
, nsIStyleRuleProcessor
)
31 SVGAttrAnimationRuleProcessor::RulesMatching(ElementRuleProcessorData
* aData
)
33 ElementRulesMatching(aData
->mElement
, aData
->mRuleWalker
);
37 SVGAttrAnimationRuleProcessor::ElementRulesMatching(Element
* aElement
,
38 nsRuleWalker
* aRuleWalker
)
40 if (aElement
->IsSVG()) {
41 static_cast<nsSVGElement
*>(aElement
)->
42 WalkAnimatedContentStyleRules(aRuleWalker
);
46 /* virtual */ nsRestyleHint
47 SVGAttrAnimationRuleProcessor::HasStateDependentStyle(StateRuleProcessorData
* aData
)
49 return nsRestyleHint(0);
52 /* virtual */ nsRestyleHint
53 SVGAttrAnimationRuleProcessor::HasStateDependentStyle(PseudoElementStateRuleProcessorData
* aData
)
55 return nsRestyleHint(0);
59 SVGAttrAnimationRuleProcessor::HasDocumentStateDependentStyle(StateRuleProcessorData
* aData
)
64 /* virtual */ nsRestyleHint
65 SVGAttrAnimationRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData
* aData
)
67 return nsRestyleHint(0);
71 SVGAttrAnimationRuleProcessor::MediumFeaturesChanged(nsPresContext
* aPresContext
)
77 SVGAttrAnimationRuleProcessor::RulesMatching(PseudoElementRuleProcessorData
* aData
)
79 // If SMIL Animation of SVG attributes can ever target
80 // pseudo-elements, we need to adjust either
81 // nsStyleSet::RuleNodeWithReplacement or the test in
82 // ElementRestyler::RestyleSelf (added in bug 977991 patch 4) to
83 // handle such styles.
87 SVGAttrAnimationRuleProcessor::RulesMatching(AnonBoxRuleProcessorData
* aData
)
89 // If SMIL Animation of SVG attributes can ever target anonymous boxes,
90 // see comment in RulesMatching(PseudoElementRuleProcessorData*).
95 SVGAttrAnimationRuleProcessor::RulesMatching(XULTreeRuleProcessorData
* aData
)
97 // If SMIL Animation of SVG attributes can ever target XUL tree pseudos,
98 // see comment in RulesMatching(PseudoElementRuleProcessorData*).
103 SVGAttrAnimationRuleProcessor::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf
) const
105 return 0; // SVGAttrAnimationRuleProcessors are charged to the DOM, not layout
109 SVGAttrAnimationRuleProcessor::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf
) const
111 return 0; // SVGAttrAnimationRuleProcessors are charged to the DOM, not layout
115 SVGAttrAnimationRuleProcessor::DOMSizeOfIncludingThis(MallocSizeOf aMallocSizeOf
) const
117 size_t n
= aMallocSizeOf(this);