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
);
18 class SVGForeignObjectFrame
;
22 class SVGForeignObjectElement final
: public SVGGraphicsElement
{
23 friend class mozilla::SVGForeignObjectFrame
;
26 friend nsresult(::NS_NewSVGForeignObjectElement(
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
;
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
);
48 already_AddRefed
<DOMSVGAnimatedLength
> X();
49 already_AddRefed
<DOMSVGAnimatedLength
> Y();
50 already_AddRefed
<DOMSVGAnimatedLength
> Width();
51 already_AddRefed
<DOMSVGAnimatedLength
> Height();
54 LengthAttributesInfo
GetLengthInfo() override
;
56 enum { ATTR_X
, ATTR_Y
, ATTR_WIDTH
, ATTR_HEIGHT
};
57 SVGAnimatedLength mLengthAttributes
[4];
58 static LengthInfo sLengthInfo
[4];
62 } // namespace mozilla
64 #endif // DOM_SVG_SVGFOREIGNOBJECTELEMENT_H_