Bumping manifests a=b2g-bump
[gecko.git] / layout / svg / nsSVGFilterFrame.h
blob1fcc9eb888483587b662b6f89e21c676efb8f8c5
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef __NS_SVGFILTERFRAME_H__
7 #define __NS_SVGFILTERFRAME_H__
9 #include "mozilla/Attributes.h"
10 #include "nsFrame.h"
11 #include "nsQueryFrame.h"
12 #include "nsSVGContainerFrame.h"
13 #include "nsSVGUtils.h"
15 class nsIAtom;
16 class nsIContent;
17 class nsIFrame;
18 class nsIPresShell;
19 class nsStyleContext;
20 class nsSVGIntegerPair;
21 class nsSVGLength2;
23 struct nsRect;
25 namespace mozilla {
26 namespace dom {
27 class SVGFilterElement;
31 typedef nsSVGContainerFrame nsSVGFilterFrameBase;
33 class nsSVGFilterFrame : public nsSVGFilterFrameBase
35 friend nsIFrame*
36 NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
37 protected:
38 explicit nsSVGFilterFrame(nsStyleContext* aContext)
39 : nsSVGFilterFrameBase(aContext),
40 mLoopFlag(false),
41 mNoHRefURI(false)
43 AddStateBits(NS_FRAME_IS_NONDISPLAY);
46 public:
47 NS_DECL_FRAMEARENA_HELPERS
49 // nsIFrame methods:
50 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
51 const nsRect& aDirtyRect,
52 const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
54 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
55 nsIAtom* aAttribute,
56 int32_t aModType) MOZ_OVERRIDE;
58 #ifdef DEBUG
59 virtual void Init(nsIContent* aContent,
60 nsContainerFrame* aParent,
61 nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
62 #endif
64 /**
65 * Get the "type" of the frame
67 * @see nsGkAtoms::svgFilterFrame
69 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
71 private:
72 // Parse our xlink:href and set up our nsSVGPaintingProperty if we
73 // reference another filter and we don't have a property. Return
74 // the referenced filter's frame if available, null otherwise.
75 class AutoFilterReferencer;
76 friend class nsSVGFilterInstance;
77 nsSVGFilterFrame* GetReferencedFilter();
78 nsSVGFilterFrame* GetReferencedFilterIfNotInUse();
80 // Accessors to lookup filter attributes
81 uint16_t GetEnumValue(uint32_t aIndex, nsIContent *aDefault);
82 uint16_t GetEnumValue(uint32_t aIndex)
84 return GetEnumValue(aIndex, mContent);
86 const nsSVGLength2 *GetLengthValue(uint32_t aIndex, nsIContent *aDefault);
87 const nsSVGLength2 *GetLengthValue(uint32_t aIndex)
89 return GetLengthValue(aIndex, mContent);
91 const mozilla::dom::SVGFilterElement *GetFilterContent(nsIContent *aDefault);
92 const mozilla::dom::SVGFilterElement *GetFilterContent()
94 return GetFilterContent(mContent);
97 // This flag is used to detect loops in xlink:href processing
98 bool mLoopFlag;
99 bool mNoHRefURI;
102 #endif