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/. */
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2013-01-24 00:59:06 +04:00
|
|
|
#ifndef mozilla_dom_SVGMaskElement_h
|
|
|
|
#define mozilla_dom_SVGMaskElement_h
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2019-04-04 20:40:56 +03:00
|
|
|
#include "SVGAnimatedEnumeration.h"
|
2019-04-09 23:04:33 +03:00
|
|
|
#include "SVGAnimatedLength.h"
|
2019-01-02 21:24:11 +03:00
|
|
|
#include "mozilla/dom/SVGElement.h"
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2013-01-24 00:59:06 +04:00
|
|
|
class nsSVGMaskFrame;
|
|
|
|
|
|
|
|
nsresult NS_NewSVGMaskElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-01-24 00:59:06 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2006-04-14 19:09:39 +04:00
|
|
|
//--------------------- Masks ------------------------
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2018-12-21 11:58:14 +03:00
|
|
|
typedef SVGElement SVGMaskElementBase;
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGMaskElement final : public SVGMaskElementBase {
|
2013-01-24 00:59:06 +04:00
|
|
|
friend class ::nsSVGMaskFrame;
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2006-04-14 19:09:39 +04:00
|
|
|
protected:
|
2013-01-24 00:59:06 +04:00
|
|
|
friend nsresult(::NS_NewSVGMaskElement(
|
|
|
|
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 SVGMaskElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* cx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2000-04-01 18:38:51 +04:00
|
|
|
|
2006-04-14 19:09:39 +04:00
|
|
|
public:
|
2006-10-20 03:48:12 +04:00
|
|
|
// nsIContent interface
|
2018-08-09 02:58:44 +03:00
|
|
|
virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
2017-10-03 01:05:19 +03:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) 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;
|
2013-01-24 00:59:46 +04:00
|
|
|
|
|
|
|
// WebIDL
|
2019-03-19 03:01:03 +03:00
|
|
|
already_AddRefed<DOMSVGAnimatedEnumeration> MaskUnits();
|
|
|
|
already_AddRefed<DOMSVGAnimatedEnumeration> MaskContentUnits();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> X();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Y();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Width();
|
|
|
|
already_AddRefed<DOMSVGAnimatedLength> Height();
|
2013-01-24 00:59:46 +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;
|
2006-04-14 19:09:39 +04:00
|
|
|
|
2013-01-24 00:59:46 +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 { MASKUNITS, MASKCONTENTUNITS };
|
2019-04-04 20:40:56 +03:00
|
|
|
SVGAnimatedEnumeration mEnumAttributes[2];
|
2007-08-28 03:11:14 +04:00
|
|
|
static EnumInfo sEnumInfo[2];
|
2006-04-14 19:09:39 +04:00
|
|
|
};
|
|
|
|
|
2013-01-24 00:59:06 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGMaskElement_h
|