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
= SVGFilterPrimitiveElement
;
22 class SVGFEDropShadowElement final
: public SVGFEDropShadowElementBase
{
23 friend nsresult(::NS_NewSVGFEDropShadowElement(
25 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
));
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
;
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
];
45 bool OutputIsTainted(const nsTArray
<bool>& aInputsAreTainted
,
46 nsIPrincipal
* aReferencePrincipal
) override
;
48 void GetSourceImageNames(nsTArray
<SVGStringInfo
>& aSources
) override
;
50 // nsIContent interface
51 nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
54 already_AddRefed
<DOMSVGAnimatedString
> In1();
55 already_AddRefed
<DOMSVGAnimatedNumber
> Dx();
56 already_AddRefed
<DOMSVGAnimatedNumber
> Dy();
57 already_AddRefed
<DOMSVGAnimatedNumber
> StdDeviationX();
58 already_AddRefed
<DOMSVGAnimatedNumber
> StdDeviationY();
59 void SetStdDeviation(float stdDeviationX
, float stdDeviationY
);
62 NumberAttributesInfo
GetNumberInfo() override
;
63 NumberPairAttributesInfo
GetNumberPairInfo() override
;
64 StringAttributesInfo
GetStringInfo() override
;
67 SVGAnimatedNumber mNumberAttributes
[2];
68 static NumberInfo sNumberInfo
[2];
71 SVGAnimatedNumberPair mNumberPairAttributes
[1];
72 static NumberPairInfo sNumberPairInfo
[1];
75 SVGAnimatedString mStringAttributes
[2];
76 static StringInfo sStringInfo
[2];
79 } // namespace mozilla::dom
81 #endif // DOM_SVG_SVGFEDROPSHADOWELEMENT_H_