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: */
|
2012-05-21 15:12:37 +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/. */
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#ifndef DOM_SVG_SVGPATTERNELEMENT_H_
|
|
|
|
#define DOM_SVG_SVGPATTERNELEMENT_H_
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2019-04-04 20:40:56 +03:00
|
|
|
#include "SVGAnimatedEnumeration.h"
|
2019-04-09 23:04:33 +03:00
|
|
|
#include "SVGAnimatedLength.h"
|
2018-12-27 20:30:38 +03:00
|
|
|
#include "SVGAnimatedPreserveAspectRatio.h"
|
2019-04-04 20:40:56 +03:00
|
|
|
#include "SVGAnimatedString.h"
|
2018-12-27 20:30:38 +03:00
|
|
|
#include "SVGAnimatedTransformList.h"
|
2019-04-04 20:40:56 +03:00
|
|
|
#include "SVGAnimatedViewBox.h"
|
2019-01-02 21:24:11 +03:00
|
|
|
#include "mozilla/dom/SVGElement.h"
|
2020-02-25 23:03:26 +03:00
|
|
|
#include "mozilla/UniquePtr.h"
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
nsresult NS_NewSVGPatternElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
namespace mozilla {
|
2020-07-07 16:49:30 +03:00
|
|
|
class SVGPatternFrame;
|
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
namespace dom {
|
2018-12-23 14:08:14 +03:00
|
|
|
class DOMSVGAnimatedTransformList;
|
2013-01-17 00:51:00 +04:00
|
|
|
|
2020-07-15 13:37:55 +03:00
|
|
|
using SVGPatternElementBase = SVGElement;
|
2013-01-17 00:51:00 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGPatternElement final : public SVGPatternElementBase {
|
2020-07-07 16:49:30 +03:00
|
|
|
friend class mozilla::SVGPatternFrame;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
|
|
|
protected:
|
2013-01-17 00:51:00 +04:00
|
|
|
friend nsresult(::NS_NewSVGPatternElement(
|
|
|
|
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 SVGPatternElement(
|
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2022-12-03 22:18:26 +03:00
|
|
|
JSObject* WrapNode(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
// nsIContent interface
|
2017-10-03 01:05:19 +03:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2022-12-03 22:18:26 +03:00
|
|
|
nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
2006-09-05 14:22:54 +04:00
|
|
|
|
2020-07-11 05:20:20 +03:00
|
|
|
// SVGSVGElement methods:
|
2022-12-03 22:18:26 +03:00
|
|
|
bool HasValidDimensions() const override;
|
2012-03-03 13:21:09 +04:00
|
|
|
|
2018-12-27 02:46:38 +03:00
|
|
|
virtual mozilla::SVGAnimatedTransformList* GetAnimatedTransformList(
|
2015-03-21 19:28:04 +03:00
|
|
|
uint32_t aFlags = 0) override;
|
2022-12-03 22:18:26 +03:00
|
|
|
nsStaticAtom* GetTransformListAttrName() const override {
|
2011-09-26 01:04:31 +04:00
|
|
|
return nsGkAtoms::patternTransform;
|
|
|
|
}
|
2013-01-17 00:51:00 +04:00
|
|
|
|
|
|
|
// WebIDL
|
2013-05-09 21:42:12 +04:00
|
|
|
already_AddRefed<SVGAnimatedRect> ViewBox();
|
2013-01-17 00:51:00 +04:00
|
|
|
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
|
2019-03-19 03:01:03 +03:00
|
|
|
already_AddRefed<DOMSVGAnimatedEnumeration> PatternUnits();
|
|
|
|
already_AddRefed<DOMSVGAnimatedEnumeration> PatternContentUnits();
|
2018-12-23 14:08:14 +03:00
|
|
|
already_AddRefed<DOMSVGAnimatedTransformList> PatternTransform();
|
2019-03-19 03:01:03 +03:00
|
|
|
already_AddRefed<DOMSVGAnimatedLength> X();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Y();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Width();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Height();
|
|
|
|
already_AddRefed<DOMSVGAnimatedString> Href();
|
2013-01-17 00:51:00 +04:00
|
|
|
|
2006-04-14 19:09:39 +04:00
|
|
|
protected:
|
2022-12-03 22:18:26 +03:00
|
|
|
LengthAttributesInfo GetLengthInfo() override;
|
|
|
|
EnumAttributesInfo GetEnumInfo() override;
|
|
|
|
StringAttributesInfo GetStringInfo() override;
|
2019-04-10 07:08:14 +03:00
|
|
|
virtual SVGAnimatedPreserveAspectRatio* GetAnimatedPreserveAspectRatio()
|
|
|
|
override;
|
2022-12-03 22:18:26 +03:00
|
|
|
SVGAnimatedViewBox* GetAnimatedViewBox() override;
|
2007-08-28 03:11:14 +04:00
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
2019-04-09 23:04:33 +03:00
|
|
|
SVGAnimatedLength mLengthAttributes[4];
|
2006-04-14 19:09:39 +04:00
|
|
|
static LengthInfo sLengthInfo[4];
|
|
|
|
|
2007-08-28 03:11:14 +04:00
|
|
|
enum { PATTERNUNITS, PATTERNCONTENTUNITS };
|
2019-04-04 20:40:56 +03:00
|
|
|
SVGAnimatedEnumeration mEnumAttributes[2];
|
2007-08-28 03:11:14 +04:00
|
|
|
static EnumInfo sEnumInfo[2];
|
|
|
|
|
2020-02-25 23:03:26 +03:00
|
|
|
UniquePtr<mozilla::SVGAnimatedTransformList> mPatternTransform;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2016-07-06 12:00:41 +03:00
|
|
|
enum { HREF, XLINK_HREF };
|
2019-04-04 20:40:56 +03:00
|
|
|
SVGAnimatedString mStringAttributes[2];
|
2016-07-06 12:00:41 +03:00
|
|
|
static StringInfo sStringInfo[2];
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2013-01-30 02:11:45 +04:00
|
|
|
// SVGFitToViewbox properties
|
2019-04-04 20:40:56 +03:00
|
|
|
SVGAnimatedViewBox mViewBox;
|
2010-12-20 03:45:29 +03:00
|
|
|
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
2006-04-14 19:09:39 +04:00
|
|
|
};
|
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#endif // DOM_SVG_SVGPATTERNELEMENT_H_
|