Bug 1805294 [wpt PR 37463] - WebKit export of https://bugs.webkit.org/show_bug.cgi...
[gecko.git] / dom / svg / SVGPolyElement.h
blob1fcc43b3507885059e374820f9ebd3b7957a4878
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_SVGPOLYELEMENT_H_
8 #define DOM_SVG_SVGPOLYELEMENT_H_
10 #include "mozilla/Attributes.h"
11 #include "SVGAnimatedPointList.h"
12 #include "SVGGeometryElement.h"
14 namespace mozilla::dom {
16 class DOMSVGPointList;
18 using SVGPolyElementBase = SVGGeometryElement;
20 class SVGPolyElement : public SVGPolyElementBase {
21 protected:
22 explicit SVGPolyElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
24 virtual ~SVGPolyElement() = default;
26 public:
27 // interfaces
29 NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGPolyElement, SVGPolyElementBase)
31 // nsIContent interface
32 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override;
34 SVGAnimatedPointList* GetAnimatedPointList() override { return &mPoints; }
35 nsStaticAtom* GetPointListAttrName() const override {
36 return nsGkAtoms::points;
39 // SVGElement methods:
40 bool HasValidDimensions() const override;
42 // SVGGeometryElement methods:
43 bool AttributeDefinesGeometry(const nsAtom* aName) override;
44 bool IsMarkable() override { return true; }
45 void GetMarkPoints(nsTArray<SVGMark>* aMarks) override;
46 bool GetGeometryBounds(
47 Rect* aBounds, const StrokeOptions& aStrokeOptions,
48 const Matrix& aToBoundsSpace,
49 const Matrix* aToNonScalingStrokeSpace = nullptr) override;
51 // WebIDL
52 already_AddRefed<DOMSVGPointList> Points();
53 already_AddRefed<DOMSVGPointList> AnimatedPoints();
55 protected:
56 SVGAnimatedPointList mPoints;
59 } // namespace mozilla::dom
61 #endif // DOM_SVG_SVGPOLYELEMENT_H_