Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / dom / svg / SVGForeignObjectElement.h
blobbd313a689d5622d6e54083a2cadc23ae8077f2eb
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_SVGFOREIGNOBJECTELEMENT_H_
8 #define DOM_SVG_SVGFOREIGNOBJECTELEMENT_H_
10 #include "mozilla/dom/SVGGraphicsElement.h"
11 #include "nsCSSPropertyID.h"
12 #include "SVGAnimatedLength.h"
14 nsresult NS_NewSVGForeignObjectElement(
15 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
17 namespace mozilla {
18 class SVGForeignObjectFrame;
20 namespace dom {
22 class SVGForeignObjectElement final : public SVGGraphicsElement {
23 friend class mozilla::SVGForeignObjectFrame;
25 protected:
26 friend nsresult(::NS_NewSVGForeignObjectElement(
27 nsIContent** aResult,
28 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
29 explicit SVGForeignObjectElement(
30 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
31 JSObject* WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
33 public:
34 // SVGElement specializations:
35 virtual gfxMatrix PrependLocalTransformsTo(
36 const gfxMatrix& aMatrix,
37 SVGTransformTypes aWhich = eAllTransforms) const override;
38 bool HasValidDimensions() const override;
40 // nsIContent interface
41 NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override;
43 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
45 static nsCSSPropertyID GetCSSPropertyIdForAttrEnum(uint8_t aAttrEnum);
47 // WebIDL
48 already_AddRefed<DOMSVGAnimatedLength> X();
49 already_AddRefed<DOMSVGAnimatedLength> Y();
50 already_AddRefed<DOMSVGAnimatedLength> Width();
51 already_AddRefed<DOMSVGAnimatedLength> Height();
53 protected:
54 LengthAttributesInfo GetLengthInfo() override;
56 enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
57 SVGAnimatedLength mLengthAttributes[4];
58 static LengthInfo sLengthInfo[4];
61 } // namespace dom
62 } // namespace mozilla
64 #endif // DOM_SVG_SVGFOREIGNOBJECTELEMENT_H_