Bug 1859059 - increase chunk number for windows debug mochitest-browser-chrome jobs...
[gecko.git] / layout / svg / SVGFilterFrame.h
blobe8400084832165d54b2648878f934f978ac5b11f
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"
14 class nsAtom;
15 class nsIContent;
16 class nsIFrame;
18 struct nsRect;
20 namespace mozilla {
21 class SVGAnimatedLength;
22 class SVGFilterInstance;
23 class PresShell;
25 namespace dom {
26 class SVGFilterElement;
27 } // namespace dom
28 } // namespace mozilla
30 nsIFrame* NS_NewSVGFilterFrame(mozilla::PresShell* aPresShell,
31 mozilla::ComputedStyle* aStyle);
33 namespace mozilla {
35 class SVGFilterFrame final : public SVGContainerFrame {
36 friend nsIFrame* ::NS_NewSVGFilterFrame(mozilla::PresShell* aPresShell,
37 ComputedStyle* aStyle);
39 protected:
40 explicit SVGFilterFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
41 : SVGContainerFrame(aStyle, aPresContext, kClassID),
42 mLoopFlag(false),
43 mNoHRefURI(false) {
44 AddStateBits(NS_FRAME_IS_NONDISPLAY |
45 NS_STATE_SVG_RENDERING_OBSERVER_CONTAINER);
48 public:
49 NS_DECL_FRAMEARENA_HELPERS(SVGFilterFrame)
51 // nsIFrame methods:
52 void BuildDisplayList(nsDisplayListBuilder* aBuilder,
53 const nsDisplayListSet& aLists) override {}
55 nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
56 int32_t aModType) override;
58 #ifdef DEBUG
59 void Init(nsIContent* aContent, nsContainerFrame* aParent,
60 nsIFrame* aPrevInFlow) override;
61 #endif
63 private:
64 friend class SVGFilterInstance;
66 /**
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
88 bool mLoopFlag;
89 bool mNoHRefURI;
92 } // namespace mozilla
94 #endif // LAYOUT_SVG_SVGFILTERFRAME_H_