Backed out 4 changesets (bug 1825722) for causing reftest failures CLOSED TREE
[gecko.git] / dom / svg / SVGFEOffsetElement.h
blobee39d1b900c7e9dc5db4ba4139fd494fb4ca681a
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_SVGFEOFFSETELEMENT_H_
8 #define DOM_SVG_SVGFEOFFSETELEMENT_H_
10 #include "SVGAnimatedNumber.h"
11 #include "SVGAnimatedString.h"
12 #include "mozilla/dom/SVGFilters.h"
14 nsresult NS_NewSVGFEOffsetElement(
15 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
17 namespace mozilla::dom {
19 using SVGFEOffsetElementBase = SVGFilterPrimitiveElement;
21 class SVGFEOffsetElement final : public SVGFEOffsetElementBase {
22 friend nsresult(::NS_NewSVGFEOffsetElement(
23 nsIContent** aResult,
24 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
26 protected:
27 explicit SVGFEOffsetElement(
28 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
29 : SVGFEOffsetElementBase(std::move(aNodeInfo)) {}
30 JSObject* WrapNode(JSContext* aCx,
31 JS::Handle<JSObject*> aGivenProto) override;
33 public:
34 FilterPrimitiveDescription GetPrimitiveDescription(
35 SVGFilterInstance* aInstance, const IntRect& aFilterSubregion,
36 const nsTArray<bool>& aInputsAreTainted,
37 nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
38 bool AttributeAffectsRendering(int32_t aNameSpaceID,
39 nsAtom* aAttribute) const override;
40 SVGAnimatedString& GetResultImageName() override {
41 return mStringAttributes[RESULT];
43 void GetSourceImageNames(nsTArray<SVGStringInfo>& aSources) override;
45 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
47 nsresult BindToTree(BindContext&, nsINode& aParent) override;
49 // WebIDL
50 already_AddRefed<DOMSVGAnimatedString> In1();
51 already_AddRefed<DOMSVGAnimatedNumber> Dx();
52 already_AddRefed<DOMSVGAnimatedNumber> Dy();
54 protected:
55 NumberAttributesInfo GetNumberInfo() override;
56 StringAttributesInfo GetStringInfo() override;
58 enum { DX, DY };
59 SVGAnimatedNumber mNumberAttributes[2];
60 static NumberInfo sNumberInfo[2];
62 enum { RESULT, IN1 };
63 SVGAnimatedString mStringAttributes[2];
64 static StringInfo sStringInfo[2];
67 } // namespace mozilla::dom
69 #endif // DOM_SVG_SVGFEOFFSETELEMENT_H_