Bug 1265584 [wpt PR 11167] - [Gecko Bug 1265584] Move wptrunner marionette usage...
[gecko.git] / dom / svg / SVGMaskElement.h
blob6c89467b76435b29249ce3388955f90eadda39d7
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 mozilla_dom_SVGMaskElement_h
8 #define mozilla_dom_SVGMaskElement_h
10 #include "nsSVGEnum.h"
11 #include "nsSVGLength2.h"
12 #include "nsSVGElement.h"
14 class nsSVGMaskFrame;
16 nsresult NS_NewSVGMaskElement(nsIContent **aResult,
17 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
19 namespace mozilla {
20 namespace dom {
22 //--------------------- Masks ------------------------
24 typedef nsSVGElement SVGMaskElementBase;
26 class SVGMaskElement final : public SVGMaskElementBase
28 friend class ::nsSVGMaskFrame;
30 protected:
31 friend nsresult (::NS_NewSVGMaskElement(nsIContent **aResult,
32 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
33 explicit SVGMaskElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
34 virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
36 public:
37 // nsIContent interface
38 virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
39 bool aPreallocateChildren) const override;
40 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
42 // nsSVGSVGElement methods:
43 virtual bool HasValidDimensions() const override;
45 // WebIDL
46 already_AddRefed<SVGAnimatedEnumeration> MaskUnits();
47 already_AddRefed<SVGAnimatedEnumeration> MaskContentUnits();
48 already_AddRefed<SVGAnimatedLength> X();
49 already_AddRefed<SVGAnimatedLength> Y();
50 already_AddRefed<SVGAnimatedLength> Width();
51 already_AddRefed<SVGAnimatedLength> Height();
53 protected:
55 virtual LengthAttributesInfo GetLengthInfo() override;
56 virtual EnumAttributesInfo GetEnumInfo() override;
58 enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
59 nsSVGLength2 mLengthAttributes[4];
60 static LengthInfo sLengthInfo[4];
62 enum { MASKUNITS, MASKCONTENTUNITS };
63 nsSVGEnum mEnumAttributes[2];
64 static EnumInfo sEnumInfo[2];
67 } // namespace dom
68 } // namespace mozilla
70 #endif // mozilla_dom_SVGMaskElement_h