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"
11 #include "nsQueryFrame.h"
12 #include "nsSVGContainerFrame.h"
13 #include "nsSVGUtils.h"
19 class nsRenderingContext
;
21 class nsSVGIntegerPair
;
28 class SVGFilterElement
;
32 typedef nsSVGContainerFrame nsSVGFilterFrameBase
;
34 class nsSVGFilterFrame
: public nsSVGFilterFrameBase
37 NS_NewSVGFilterFrame(nsIPresShell
* aPresShell
, nsStyleContext
* aContext
);
39 explicit nsSVGFilterFrame(nsStyleContext
* aContext
)
40 : nsSVGFilterFrameBase(aContext
),
44 AddStateBits(NS_FRAME_IS_NONDISPLAY
);
48 NS_DECL_FRAMEARENA_HELPERS
51 virtual void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
52 const nsRect
& aDirtyRect
,
53 const nsDisplayListSet
& aLists
) MOZ_OVERRIDE
{}
55 virtual nsresult
AttributeChanged(int32_t aNameSpaceID
,
57 int32_t aModType
) MOZ_OVERRIDE
;
60 virtual void Init(nsIContent
* aContent
,
61 nsContainerFrame
* aParent
,
62 nsIFrame
* aPrevInFlow
) MOZ_OVERRIDE
;
66 * Get the "type" of the frame
68 * @see nsGkAtoms::svgFilterFrame
70 virtual nsIAtom
* GetType() const MOZ_OVERRIDE
;
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