Bumping manifests a=b2g-bump
[gecko.git] / layout / svg / nsSVGFilterFrame.h
blob47d3ea475b500f3a32bb532f345375169fe9f6f7
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 nsRenderingContext;
20 class nsStyleContext;
21 class nsSVGIntegerPair;
22 class nsSVGLength2;
24 struct nsRect;
26 namespace mozilla {
27 namespace dom {
28 class SVGFilterElement;
32 typedef nsSVGContainerFrame nsSVGFilterFrameBase;
34 class nsSVGFilterFrame : public nsSVGFilterFrameBase
36 friend nsIFrame*
37 NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
38 protected:
39 explicit nsSVGFilterFrame(nsStyleContext* aContext)
40 : nsSVGFilterFrameBase(aContext),
41 mLoopFlag(false),
42 mNoHRefURI(false)
44 AddStateBits(NS_FRAME_IS_NONDISPLAY);
47 public:
48 NS_DECL_FRAMEARENA_HELPERS
50 // nsIFrame methods:
51 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
52 const nsRect& aDirtyRect,
53 const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
55 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
56 nsIAtom* aAttribute,
57 int32_t aModType) MOZ_OVERRIDE;
59 #ifdef DEBUG
60 virtual void Init(nsIContent* aContent,
61 nsContainerFrame* aParent,
62 nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
63 #endif
65 /**
66 * Get the "type" of the frame
68 * @see nsGkAtoms::svgFilterFrame
70 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
72 private:
73 // Parse our xlink:href and set up our nsSVGPaintingProperty if we
74 // reference another filter and we don't have a property. Return
75 // the referenced filter's frame if available, null otherwise.
76 class AutoFilterReferencer;
77 friend class nsSVGFilterInstance;
78 nsSVGFilterFrame* GetReferencedFilter();
79 nsSVGFilterFrame* GetReferencedFilterIfNotInUse();
81 // Accessors to lookup filter attributes
82 uint16_t GetEnumValue(uint32_t aIndex, nsIContent *aDefault);
83 uint16_t GetEnumValue(uint32_t aIndex)
85 return GetEnumValue(aIndex, mContent);
87 const nsSVGLength2 *GetLengthValue(uint32_t aIndex, nsIContent *aDefault);
88 const nsSVGLength2 *GetLengthValue(uint32_t aIndex)
90 return GetLengthValue(aIndex, mContent);
92 const mozilla::dom::SVGFilterElement *GetFilterContent(nsIContent *aDefault);
93 const mozilla::dom::SVGFilterElement *GetFilterContent()
95 return GetFilterContent(mContent);
98 // This flag is used to detect loops in xlink:href processing
99 bool mLoopFlag;
100 bool mNoHRefURI;
103 #endif