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
|
45 NS_STATE_SVG_RENDERING_OBSERVER_CONTAINER
);
49 NS_DECL_FRAMEARENA_HELPERS(SVGFilterFrame
)
52 void BuildDisplayList(nsDisplayListBuilder
* aBuilder
,
53 const nsDisplayListSet
& aLists
) override
{}
55 nsresult
AttributeChanged(int32_t aNameSpaceID
, nsAtom
* aAttribute
,
56 int32_t aModType
) override
;
59 void Init(nsIContent
* aContent
, nsContainerFrame
* aParent
,
60 nsIFrame
* aPrevInFlow
) override
;
64 friend class SVGFilterInstance
;
67 * Parses this frame's href and - if it references another filter - returns
68 * it. It also makes this frame a rendering observer of the specified ID.
70 SVGFilterFrame
* GetReferencedFilter();
72 // Accessors to lookup filter attributes
73 uint16_t GetEnumValue(uint32_t aIndex
, nsIContent
* aDefault
);
74 uint16_t GetEnumValue(uint32_t aIndex
) {
75 return GetEnumValue(aIndex
, mContent
);
77 const mozilla::SVGAnimatedLength
* GetLengthValue(uint32_t aIndex
,
78 nsIContent
* aDefault
);
79 const mozilla::SVGAnimatedLength
* GetLengthValue(uint32_t aIndex
) {
80 return GetLengthValue(aIndex
, mContent
);
82 const mozilla::dom::SVGFilterElement
* GetFilterContent(nsIContent
* aDefault
);
83 const mozilla::dom::SVGFilterElement
* GetFilterContent() {
84 return GetFilterContent(mContent
);
87 // This flag is used to detect loops in xlink:href processing
92 } // namespace mozilla
94 #endif // LAYOUT_SVG_SVGFILTERFRAME_H_