1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef LAYOUT_SVG_SVGFILTERFRAME_H_
8 #define LAYOUT_SVG_SVGFILTERFRAME_H_
10 #include "mozilla/Attributes.h"
11 #include "mozilla/SVGContainerFrame.h"
12 #include "nsQueryFrame.h"
21 class SVGAnimatedLength
;
22 class SVGFilterInstance
;
26 class SVGFilterElement
;
28 } // namespace mozilla
30 nsIFrame
* NS_NewSVGFilterFrame(mozilla::PresShell
* aPresShell
,
31 mozilla::ComputedStyle
* aStyle
);
35 class SVGFilterFrame final
: public SVGContainerFrame
{
36 friend nsIFrame
* ::NS_NewSVGFilterFrame(mozilla::PresShell
* aPresShell
,
37 ComputedStyle
* aStyle
);
40 explicit SVGFilterFrame(ComputedStyle
* aStyle
, nsPresContext
* aPresContext
)
41 : SVGContainerFrame(aStyle
, aPresContext
, kClassID
),
44 AddStateBits(NS_FRAME_IS_NONDISPLAY
);
48 NS_DECL_FRAMEARENA_HELPERS(SVGFilterFrame
)
51 virtual void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
52 const nsDisplayListSet
& aLists
) override
{}
54 virtual nsresult
AttributeChanged(int32_t aNameSpaceID
, nsAtom
* aAttribute
,
55 int32_t aModType
) override
;
58 virtual void Init(nsIContent
* aContent
, nsContainerFrame
* aParent
,
59 nsIFrame
* aPrevInFlow
) override
;
63 friend class SVGFilterInstance
;
66 * Parses this frame's href and - if it references another filter - returns
67 * it. It also makes this frame a rendering observer of the specified ID.
69 SVGFilterFrame
* GetReferencedFilter();
71 // Accessors to lookup filter attributes
72 uint16_t GetEnumValue(uint32_t aIndex
, nsIContent
* aDefault
);
73 uint16_t GetEnumValue(uint32_t aIndex
) {
74 return GetEnumValue(aIndex
, mContent
);
76 const mozilla::SVGAnimatedLength
* GetLengthValue(uint32_t aIndex
,
77 nsIContent
* aDefault
);
78 const mozilla::SVGAnimatedLength
* GetLengthValue(uint32_t aIndex
) {
79 return GetLengthValue(aIndex
, mContent
);
81 const mozilla::dom::SVGFilterElement
* GetFilterContent(nsIContent
* aDefault
);
82 const mozilla::dom::SVGFilterElement
* GetFilterContent() {
83 return GetFilterContent(mContent
);
86 // This flag is used to detect loops in xlink:href processing
91 } // namespace mozilla
93 #endif // LAYOUT_SVG_SVGFILTERFRAME_H_