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"
17 class DOMSVGPointList
;
19 using SVGPolyElementBase
= SVGGeometryElement
;
21 class SVGPolyElement
: public SVGPolyElementBase
{
23 explicit SVGPolyElement(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
25 virtual ~SVGPolyElement() = default;
30 NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGPolyElement
, SVGPolyElementBase
)
32 // nsIContent interface
33 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom
* name
) const override
;
35 virtual SVGAnimatedPointList
* GetAnimatedPointList() override
{
38 virtual nsStaticAtom
* GetPointListAttrName() const override
{
39 return nsGkAtoms::points
;
42 // SVGElement methods:
43 virtual bool HasValidDimensions() const override
;
45 // SVGGeometryElement methods:
46 virtual bool AttributeDefinesGeometry(const nsAtom
* aName
) override
;
47 virtual bool IsMarkable() override
{ return true; }
48 virtual void GetMarkPoints(nsTArray
<SVGMark
>* aMarks
) override
;
49 virtual bool GetGeometryBounds(
50 Rect
* aBounds
, const StrokeOptions
& aStrokeOptions
,
51 const Matrix
& aToBoundsSpace
,
52 const Matrix
* aToNonScalingStrokeSpace
= nullptr) override
;
55 already_AddRefed
<DOMSVGPointList
> Points();
56 already_AddRefed
<DOMSVGPointList
> AnimatedPoints();
59 SVGAnimatedPointList mPoints
;
63 } // namespace mozilla
65 #endif // DOM_SVG_SVGPOLYELEMENT_H_