Bug 1748835 [wpt PR 32273] - Avoid reftest-wait timeout if ::target-text is unsupport...
[gecko.git] / layout / svg / SVGFilterFrame.h
blob71b9446e20c7041fa1e43fb403e016a43a0eabe5
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);
47 public:
48 NS_DECL_FRAMEARENA_HELPERS(SVGFilterFrame)
50 // nsIFrame methods:
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;
57 #ifdef DEBUG
58 virtual void Init(nsIContent* aContent, nsContainerFrame* aParent,
59 nsIFrame* aPrevInFlow) override;
60 #endif
62 private:
63 friend class SVGFilterInstance;
65 /**
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
87 bool mLoopFlag;
88 bool mNoHRefURI;
91 } // namespace mozilla
93 #endif // LAYOUT_SVG_SVGFILTERFRAME_H_