tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

SVGPolyElement.h (1701B)


      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/. */
      6 
      7 #ifndef DOM_SVG_SVGPOLYELEMENT_H_
      8 #define DOM_SVG_SVGPOLYELEMENT_H_
      9 
     10 #include "SVGAnimatedPointList.h"
     11 #include "SVGGeometryElement.h"
     12 
     13 namespace mozilla::dom {
     14 
     15 class DOMSVGPointList;
     16 
     17 using SVGPolyElementBase = SVGGeometryElement;
     18 
     19 class SVGPolyElement : public SVGPolyElementBase {
     20 protected:
     21  explicit SVGPolyElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
     22 
     23  virtual ~SVGPolyElement() = default;
     24 
     25 public:
     26  // interfaces
     27 
     28  NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGPolyElement, SVGPolyElementBase)
     29 
     30  SVGAnimatedPointList* GetAnimatedPointList() override { return &mPoints; }
     31  nsStaticAtom* GetPointListAttrName() const override {
     32    return nsGkAtoms::points;
     33  }
     34 
     35  // SVGElement methods:
     36  bool HasValidDimensions() const override;
     37 
     38  // SVGGeometryElement methods:
     39  bool AttributeDefinesGeometry(const nsAtom* aName) override;
     40  bool IsMarkable() override { return true; }
     41  void GetMarkPoints(nsTArray<SVGMark>* aMarks) override;
     42  bool GetGeometryBounds(
     43      Rect* aBounds, const StrokeOptions& aStrokeOptions,
     44      const Matrix& aToBoundsSpace,
     45      const Matrix* aToNonScalingStrokeSpace = nullptr) override;
     46 
     47  // WebIDL
     48  already_AddRefed<DOMSVGPointList> Points();
     49  already_AddRefed<DOMSVGPointList> AnimatedPoints();
     50 
     51 protected:
     52  SVGAnimatedPointList mPoints;
     53 };
     54 
     55 }  // namespace mozilla::dom
     56 
     57 #endif  // DOM_SVG_SVGPOLYELEMENT_H_