Backed out 4 changesets (bug 1825722) for causing reftest failures CLOSED TREE
[gecko.git] / dom / svg / SVGFEFloodElement.h
blobb4a0292ef8b2759f1f4d71eb0af7c92652502f58
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_SVGFEFLOODELEMENT_H_
8 #define DOM_SVG_SVGFEFLOODELEMENT_H_
10 #include "mozilla/dom/SVGFilters.h"
12 nsresult NS_NewSVGFEFloodElement(
13 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
15 namespace mozilla::dom {
17 using SVGFEFloodElementBase = SVGFilterPrimitiveElement;
19 class SVGFEFloodElement final : public SVGFEFloodElementBase {
20 friend nsresult(::NS_NewSVGFEFloodElement(
21 nsIContent** aResult,
22 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
24 protected:
25 explicit SVGFEFloodElement(
26 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
27 : SVGFEFloodElementBase(std::move(aNodeInfo)) {}
28 JSObject* WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
30 public:
31 bool SubregionIsUnionOfRegions() override { return false; }
33 FilterPrimitiveDescription GetPrimitiveDescription(
34 SVGFilterInstance* aInstance, const IntRect& aFilterSubregion,
35 const nsTArray<bool>& aInputsAreTainted,
36 nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
37 SVGAnimatedString& GetResultImageName() override {
38 return mStringAttributes[RESULT];
41 bool OutputIsTainted(const nsTArray<bool>& aInputsAreTainted,
42 nsIPrincipal* aReferencePrincipal) override;
44 // nsIContent interface
45 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
47 nsresult BindToTree(BindContext& aCtx, nsINode& aParent) override;
49 protected:
50 bool ProducesSRGB() override { return true; }
52 StringAttributesInfo GetStringInfo() override;
54 enum { RESULT };
55 SVGAnimatedString mStringAttributes[1];
56 static StringInfo sStringInfo[1];
59 } // namespace mozilla::dom
61 #endif // DOM_SVG_SVGFEFLOODELEMENT_H_