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
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
#ifndef mozilla_dom_SVGPatternElement_h
|
|
|
|
#define mozilla_dom_SVGPatternElement_h
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2016-06-07 23:10:18 +03:00
|
|
|
#include "nsAutoPtr.h"
|
2007-08-28 03:11:14 +04:00
|
|
|
#include "nsSVGEnum.h"
|
2012-01-26 13:57:21 +04:00
|
|
|
#include "nsSVGLength2.h"
|
2008-06-14 13:01:02 +04:00
|
|
|
#include "nsSVGString.h"
|
2012-12-23 12:22:22 +04:00
|
|
|
#include "nsSVGElement.h"
|
2009-02-03 17:42:24 +03:00
|
|
|
#include "nsSVGViewBox.h"
|
2010-12-20 03:45:29 +03:00
|
|
|
#include "SVGAnimatedPreserveAspectRatio.h"
|
2013-04-15 02:56:34 +04:00
|
|
|
#include "nsSVGAnimatedTransformList.h"
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
class nsSVGPatternFrame;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
nsresult NS_NewSVGPatternElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2013-01-17 00:51:00 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
2013-04-15 02:56:34 +04:00
|
|
|
class SVGAnimatedTransformList;
|
2013-01-17 00:51:00 +04:00
|
|
|
|
|
|
|
typedef nsSVGElement SVGPatternElementBase;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGPatternElement final : public SVGPatternElementBase
|
2006-04-14 19:09:39 +04:00
|
|
|
{
|
2013-01-17 00:51:00 +04:00
|
|
|
friend class ::nsSVGPatternFrame;
|
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));
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGPatternElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
|
|
|
public:
|
2013-03-20 07:20:38 +04:00
|
|
|
typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
|
|
|
|
|
2006-04-14 19:09:39 +04:00
|
|
|
// nsIContent interface
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* name) const override;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2017-04-20 22:57:48 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
|
|
|
bool aPreallocateChildren) const override;
|
2006-09-05 14:22:54 +04:00
|
|
|
|
2012-03-03 13:21:09 +04:00
|
|
|
// nsSVGSVGElement methods:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool HasValidDimensions() const override;
|
2012-03-03 13:21:09 +04:00
|
|
|
|
2013-04-15 02:56:34 +04:00
|
|
|
virtual mozilla::nsSVGAnimatedTransformList*
|
2015-03-21 19:28:04 +03:00
|
|
|
GetAnimatedTransformList(uint32_t aFlags = 0) override;
|
|
|
|
virtual nsIAtom* 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();
|
2013-07-01 11:02:46 +04:00
|
|
|
already_AddRefed<SVGAnimatedEnumeration> PatternUnits();
|
|
|
|
already_AddRefed<SVGAnimatedEnumeration> PatternContentUnits();
|
2013-04-15 02:56:34 +04:00
|
|
|
already_AddRefed<SVGAnimatedTransformList> PatternTransform();
|
2013-01-20 00:56:00 +04:00
|
|
|
already_AddRefed<SVGAnimatedLength> X();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Y();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Width();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Height();
|
2013-06-15 02:37:27 +04:00
|
|
|
already_AddRefed<SVGAnimatedString> Href();
|
2013-01-17 00:51:00 +04:00
|
|
|
|
2006-04-14 19:09:39 +04:00
|
|
|
protected:
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual LengthAttributesInfo GetLengthInfo() override;
|
|
|
|
virtual EnumAttributesInfo GetEnumInfo() override;
|
|
|
|
virtual nsSVGViewBox *GetViewBox() override;
|
|
|
|
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() override;
|
|
|
|
virtual StringAttributesInfo GetStringInfo() 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 };
|
2006-04-14 19:09:39 +04:00
|
|
|
nsSVGLength2 mLengthAttributes[4];
|
|
|
|
static LengthInfo sLengthInfo[4];
|
|
|
|
|
2007-08-28 03:11:14 +04:00
|
|
|
enum { PATTERNUNITS, PATTERNCONTENTUNITS };
|
|
|
|
nsSVGEnum mEnumAttributes[2];
|
|
|
|
static EnumInfo sEnumInfo[2];
|
|
|
|
|
2013-04-15 02:56:34 +04:00
|
|
|
nsAutoPtr<mozilla::nsSVGAnimatedTransformList> mPatternTransform;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2016-07-06 12:00:41 +03:00
|
|
|
enum { HREF, XLINK_HREF };
|
|
|
|
nsSVGString mStringAttributes[2];
|
|
|
|
static StringInfo sStringInfo[2];
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2013-01-30 02:11:45 +04:00
|
|
|
// SVGFitToViewbox properties
|
2009-02-03 17:42:24 +03:00
|
|
|
nsSVGViewBox 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
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGPatternElement_h
|