2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-01-06 10:25:55 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#ifndef DOM_SVG_SVGFOREIGNOBJECTELEMENT_H_
|
|
|
|
#define DOM_SVG_SVGFOREIGNOBJECTELEMENT_H_
|
2013-01-06 10:25:55 +04:00
|
|
|
|
|
|
|
#include "mozilla/dom/SVGGraphicsElement.h"
|
2019-05-16 16:21:21 +03:00
|
|
|
#include "nsCSSPropertyID.h"
|
2019-04-09 23:04:33 +03:00
|
|
|
#include "SVGAnimatedLength.h"
|
2013-01-06 10:25:55 +04:00
|
|
|
|
|
|
|
nsresult NS_NewSVGForeignObjectElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-01-06 10:25:55 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2020-06-25 23:42:49 +03:00
|
|
|
class SVGForeignObjectFrame;
|
|
|
|
|
2013-01-06 10:25:55 +04:00
|
|
|
namespace dom {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGForeignObjectElement final : public SVGGraphicsElement {
|
2020-06-25 23:42:49 +03:00
|
|
|
friend class mozilla::SVGForeignObjectFrame;
|
2013-01-06 10:25:55 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
friend nsresult(::NS_NewSVGForeignObjectElement(
|
|
|
|
nsIContent** aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2018-09-21 23:45:49 +03:00
|
|
|
explicit SVGForeignObjectElement(
|
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* cx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2013-01-06 10:25:55 +04:00
|
|
|
|
|
|
|
public:
|
2018-12-21 11:58:14 +03:00
|
|
|
// SVGElement specializations:
|
2015-12-03 01:36:23 +03:00
|
|
|
virtual gfxMatrix PrependLocalTransformsTo(
|
|
|
|
const gfxMatrix& aMatrix,
|
|
|
|
SVGTransformTypes aWhich = eAllTransforms) const override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool HasValidDimensions() const override;
|
2013-01-06 10:25:55 +04:00
|
|
|
|
|
|
|
// nsIContent interface
|
2017-10-03 01:05:19 +03:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override;
|
2013-01-06 10:25:55 +04:00
|
|
|
|
2018-08-09 02:58:44 +03:00
|
|
|
virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
2013-01-06 10:25:55 +04:00
|
|
|
|
2019-05-16 16:21:21 +03:00
|
|
|
static nsCSSPropertyID GetCSSPropertyIdForAttrEnum(uint8_t aAttrEnum);
|
|
|
|
|
2013-01-06 10:25:55 +04:00
|
|
|
// WebIDL
|
2019-03-19 03:01:03 +03:00
|
|
|
already_AddRefed<DOMSVGAnimatedLength> X();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Y();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Width();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Height();
|
2013-01-06 10:25:55 +04:00
|
|
|
|
|
|
|
protected:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual LengthAttributesInfo GetLengthInfo() override;
|
2013-01-06 10:25:55 +04:00
|
|
|
|
|
|
|
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
2019-04-09 23:04:33 +03:00
|
|
|
SVGAnimatedLength mLengthAttributes[4];
|
2013-01-06 10:25:55 +04:00
|
|
|
static LengthInfo sLengthInfo[4];
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#endif // DOM_SVG_SVGFOREIGNOBJECTELEMENT_H_
|