Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / dom / svg / SVGFEPointLightElement.h
blob44a64e15225c72725a5cc14ff9fb2876fd14103d
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_SVGFEPOINTLIGHTELEMENT_H_
8 #define DOM_SVG_SVGFEPOINTLIGHTELEMENT_H_
10 #include "SVGAnimatedNumber.h"
11 #include "mozilla/dom/SVGFilters.h"
13 nsresult NS_NewSVGFEPointLightElement(
14 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
16 namespace mozilla::dom {
18 using SVGFEPointLightElementBase = SVGFELightElement;
20 class SVGFEPointLightElement final : public SVGFEPointLightElementBase {
21 friend nsresult(::NS_NewSVGFEPointLightElement(
22 nsIContent** aResult,
23 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
25 protected:
26 explicit SVGFEPointLightElement(
27 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
28 : SVGFEPointLightElementBase(std::move(aNodeInfo)) {}
29 JSObject* WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
31 public:
32 mozilla::gfx::LightType ComputeLightAttributes(
33 SVGFilterInstance* aInstance, nsTArray<float>& aFloatAttributes) override;
34 bool AttributeAffectsRendering(int32_t aNameSpaceID,
35 nsAtom* aAttribute) const override;
37 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
39 // WebIDL
40 already_AddRefed<DOMSVGAnimatedNumber> X();
41 already_AddRefed<DOMSVGAnimatedNumber> Y();
42 already_AddRefed<DOMSVGAnimatedNumber> Z();
44 protected:
45 NumberAttributesInfo GetNumberInfo() override;
47 enum { ATTR_X, ATTR_Y, ATTR_Z };
48 SVGAnimatedNumber mNumberAttributes[3];
49 static NumberInfo sNumberInfo[3];
52 } // namespace mozilla::dom
54 #endif // DOM_SVG_SVGFEPOINTLIGHTELEMENT_H_