Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / dom / svg / SVGCircleElement.h
blob85c5d0bd9d60623c5a26888d1cac59ce5c96dbfd
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_SVGCIRCLEELEMENT_H_
8 #define DOM_SVG_SVGCIRCLEELEMENT_H_
10 #include "nsCSSPropertyID.h"
11 #include "SVGGeometryElement.h"
12 #include "SVGAnimatedLength.h"
14 nsresult NS_NewSVGCircleElement(
15 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
17 namespace mozilla {
18 class ComputedStyle;
20 namespace dom {
22 using SVGCircleElementBase = SVGGeometryElement;
24 class SVGCircleElement final : public SVGCircleElementBase {
25 protected:
26 explicit SVGCircleElement(
27 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
28 JSObject* WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
29 friend nsresult(::NS_NewSVGCircleElement(
30 nsIContent** aResult,
31 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
33 public:
34 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
36 // SVGSVGElement methods:
37 bool HasValidDimensions() const override;
39 // SVGGeometryElement methods:
40 bool GetGeometryBounds(
41 Rect* aBounds, const StrokeOptions& aStrokeOptions,
42 const Matrix& aToBoundsSpace,
43 const Matrix* aToNonScalingStrokeSpace = nullptr) override;
44 already_AddRefed<Path> BuildPath(PathBuilder* aBuilder) override;
46 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
48 static bool IsLengthChangedViaCSS(const ComputedStyle& aNewStyle,
49 const ComputedStyle& aOldStyle);
50 static nsCSSPropertyID GetCSSPropertyIdForAttrEnum(uint8_t aAttrEnum);
52 // WebIDL
53 already_AddRefed<DOMSVGAnimatedLength> Cx();
54 already_AddRefed<DOMSVGAnimatedLength> Cy();
55 already_AddRefed<DOMSVGAnimatedLength> R();
57 protected:
58 LengthAttributesInfo GetLengthInfo() override;
60 enum { ATTR_CX, ATTR_CY, ATTR_R };
61 SVGAnimatedLength mLengthAttributes[3];
62 static LengthInfo sLengthInfo[3];
65 } // namespace dom
66 } // namespace mozilla
68 #endif // DOM_SVG_SVGCIRCLEELEMENT_H_