summaryrefslogtreecommitdiffstats
path: root/layout/style/SVGAttrAnimationRuleProcessor.cpp
blob: 9eb31b1b23341b92bad27f65f4397dc1e64b4241 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/* -*- 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;
}