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
{
22 explicit SVGPolyElement(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
24 virtual ~SVGPolyElement() = default;
29 NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGPolyElement
, SVGPolyElementBase
)
31 SVGAnimatedPointList
* GetAnimatedPointList() override
{ return &mPoints
; }
32 nsStaticAtom
* GetPointListAttrName() const override
{
33 return nsGkAtoms::points
;
36 // SVGElement methods:
37 bool HasValidDimensions() const override
;
39 // SVGGeometryElement methods:
40 bool AttributeDefinesGeometry(const nsAtom
* aName
) override
;
41 bool IsMarkable() override
{ return true; }
42 void GetMarkPoints(nsTArray
<SVGMark
>* aMarks
) override
;
43 bool GetGeometryBounds(
44 Rect
* aBounds
, const StrokeOptions
& aStrokeOptions
,
45 const Matrix
& aToBoundsSpace
,
46 const Matrix
* aToNonScalingStrokeSpace
= nullptr) override
;
49 already_AddRefed
<DOMSVGPointList
> Points();
50 already_AddRefed
<DOMSVGPointList
> AnimatedPoints();
53 SVGAnimatedPointList mPoints
;
56 } // namespace mozilla::dom
58 #endif // DOM_SVG_SVGPOLYELEMENT_H_