Bug 1805294 [wpt PR 37463] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / dom / svg / SVGFEDropShadowElement.h
blob5bb1b3dcd8e3b3b4661b38133e61926f14c5eee2
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 DOM_SVG_SVGFEDROPSHADOWELEMENT_H_
8 #define DOM_SVG_SVGFEDROPSHADOWELEMENT_H_
10 #include "SVGAnimatedNumber.h"
11 #include "SVGAnimatedNumberPair.h"
12 #include "SVGAnimatedString.h"
13 #include "mozilla/dom/SVGFilters.h"
15 nsresult NS_NewSVGFEDropShadowElement(
16 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
18 namespace mozilla::dom {
20 using SVGFEDropShadowElementBase = SVGFE;
22 class SVGFEDropShadowElement : public SVGFEDropShadowElementBase {
23 friend nsresult(::NS_NewSVGFEDropShadowElement(
24 nsIContent** aResult,
25 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
27 protected:
28 explicit SVGFEDropShadowElement(
29 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
30 : SVGFEDropShadowElementBase(std::move(aNodeInfo)) {}
31 JSObject* WrapNode(JSContext* aCx,
32 JS::Handle<JSObject*> aGivenProto) override;
34 public:
35 FilterPrimitiveDescription GetPrimitiveDescription(
36 SVGFilterInstance* aInstance, const IntRect& aFilterSubregion,
37 const nsTArray<bool>& aInputsAreTainted,
38 nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
39 bool AttributeAffectsRendering(int32_t aNameSpaceID,
40 nsAtom* aAttribute) const override;
41 SVGAnimatedString& GetResultImageName() override {
42 return mStringAttributes[RESULT];
44 void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
46 // nsIContent interface
47 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
49 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
51 // WebIDL
52 already_AddRefed<DOMSVGAnimatedString> In1();
53 already_AddRefed<DOMSVGAnimatedNumber> Dx();
54 already_AddRefed<DOMSVGAnimatedNumber> Dy();
55 already_AddRefed<DOMSVGAnimatedNumber> StdDeviationX();
56 already_AddRefed<DOMSVGAnimatedNumber> StdDeviationY();
57 void SetStdDeviation(float stdDeviationX, float stdDeviationY);
59 protected:
60 NumberAttributesInfo GetNumberInfo() override;
61 NumberPairAttributesInfo GetNumberPairInfo() override;
62 StringAttributesInfo GetStringInfo() override;
64 enum { DX, DY };
65 SVGAnimatedNumber mNumberAttributes[2];
66 static NumberInfo sNumberInfo[2];
68 enum { STD_DEV };
69 SVGAnimatedNumberPair mNumberPairAttributes[1];
70 static NumberPairInfo sNumberPairInfo[1];
72 enum { RESULT, IN1 };
73 SVGAnimatedString mStringAttributes[2];
74 static StringInfo sStringInfo[2];
77 } // namespace mozilla::dom
79 #endif // DOM_SVG_SVGFEDROPSHADOWELEMENT_H_