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"
20 class nsSVGIntegerPair
;
27 class SVGFilterElement
;
31 typedef nsSVGContainerFrame nsSVGFilterFrameBase
;
33 class nsSVGFilterFrame
: public nsSVGFilterFrameBase
36 NS_NewSVGFilterFrame(nsIPresShell
* aPresShell
, nsStyleContext
* aContext
);
38 explicit nsSVGFilterFrame(nsStyleContext
* aContext
)
39 : nsSVGFilterFrameBase(aContext
),
43 AddStateBits(NS_FRAME_IS_NONDISPLAY
);
47 NS_DECL_FRAMEARENA_HELPERS
50 virtual void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
51 const nsRect
& aDirtyRect
,
52 const nsDisplayListSet
& aLists
) MOZ_OVERRIDE
{}
54 virtual nsresult
AttributeChanged(int32_t aNameSpaceID
,
56 int32_t aModType
) MOZ_OVERRIDE
;
59 virtual void Init(nsIContent
* aContent
,
60 nsContainerFrame
* aParent
,
61 nsIFrame
* aPrevInFlow
) MOZ_OVERRIDE
;
65 * Get the "type" of the frame
67 * @see nsGkAtoms::svgFilterFrame
69 virtual nsIAtom
* GetType() const MOZ_OVERRIDE
;
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