Bug 1936278 - Prevent search mode chiclet from being dismissed when clicking in page...
[gecko.git] / dom / svg / SVGFEMorphologyElement.h
blob76a91506f3f07aa6bef5237601b37094fa85ed30
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_SVGFEMORPHOLOGYELEMENT_H_
8 #define DOM_SVG_SVGFEMORPHOLOGYELEMENT_H_
10 #include "SVGAnimatedEnumeration.h"
11 #include "SVGAnimatedNumberPair.h"
12 #include "SVGAnimatedString.h"
13 #include "mozilla/dom/SVGFilters.h"
15 nsresult NS_NewSVGFEMorphologyElement(
16 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
18 namespace mozilla::dom {
20 using SVGFEMorphologyElementBase = SVGFilterPrimitiveElement;
22 class SVGFEMorphologyElement final : public SVGFEMorphologyElementBase {
23 friend nsresult(::NS_NewSVGFEMorphologyElement(
24 nsIContent** aResult,
25 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
27 protected:
28 explicit SVGFEMorphologyElement(
29 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
30 : SVGFEMorphologyElementBase(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 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
48 nsresult BindToTree(BindContext& aCtx, nsINode& aParent) override;
50 // WebIDL
51 already_AddRefed<DOMSVGAnimatedString> In1();
52 already_AddRefed<DOMSVGAnimatedEnumeration> Operator();
53 already_AddRefed<DOMSVGAnimatedNumber> RadiusX();
54 already_AddRefed<DOMSVGAnimatedNumber> RadiusY();
55 void SetRadius(float rx, float ry);
57 protected:
58 void GetRXY(int32_t* aRX, int32_t* aRY, const SVGFilterInstance& aInstance);
60 NumberPairAttributesInfo GetNumberPairInfo() override;
61 EnumAttributesInfo GetEnumInfo() override;
62 StringAttributesInfo GetStringInfo() override;
64 void UpdateUseCounter() const;
66 enum { RADIUS };
67 SVGAnimatedNumberPair mNumberPairAttributes[1];
68 static NumberPairInfo sNumberPairInfo[1];
70 enum { OPERATOR };
71 SVGAnimatedEnumeration mEnumAttributes[1];
72 static SVGEnumMapping sOperatorMap[];
73 static EnumInfo sEnumInfo[1];
75 enum { RESULT, IN1 };
76 SVGAnimatedString mStringAttributes[2];
77 static StringInfo sStringInfo[2];
80 } // namespace mozilla::dom
82 #endif // DOM_SVG_SVGFEMORPHOLOGYELEMENT_H_