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/. */
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#ifndef DOM_SVG_SVGTEXTPATHELEMENT_H_
|
|
|
|
#define DOM_SVG_SVGTEXTPATHELEMENT_H_
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2019-04-04 20:40:56 +03:00
|
|
|
#include "SVGAnimatedEnumeration.h"
|
2019-04-09 23:04:33 +03:00
|
|
|
#include "SVGAnimatedLength.h"
|
2019-03-26 21:51:25 +03:00
|
|
|
#include "SVGAnimatedPathSegList.h"
|
2019-04-04 20:40:56 +03:00
|
|
|
#include "SVGAnimatedString.h"
|
2013-02-08 23:55:49 +04:00
|
|
|
#include "mozilla/dom/SVGTextContentElement.h"
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2017-10-03 01:05:19 +03:00
|
|
|
class nsAtom;
|
2012-01-26 13:57:21 +04:00
|
|
|
class nsIContent;
|
2013-01-06 18:14:43 +04:00
|
|
|
|
|
|
|
nsresult NS_NewSVGTextPathElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2012-01-26 13:57:21 +04:00
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-03-22 21:43:50 +03:00
|
|
|
// textPath side types
|
|
|
|
static const uint16_t TEXTPATH_SIDETYPE_LEFT = 1;
|
|
|
|
static const uint16_t TEXTPATH_SIDETYPE_RIGHT = 2;
|
|
|
|
|
2020-07-15 13:37:55 +03:00
|
|
|
using SVGTextPathElementBase = SVGTextContentElement;
|
2013-01-06 18:14:43 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGTextPathElement final : public SVGTextPathElementBase {
|
2020-06-24 01:59:34 +03:00
|
|
|
friend class mozilla::SVGTextFrame;
|
2007-12-04 09:51:36 +03:00
|
|
|
|
|
|
|
protected:
|
2013-01-06 18:14:43 +04:00
|
|
|
friend nsresult(::NS_NewSVGTextPathElement(
|
|
|
|
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 SVGTextPathElement(
|
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* cx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2007-12-04 09:51:36 +03:00
|
|
|
public:
|
|
|
|
// nsIContent interface
|
2017-10-03 01:05:19 +03:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2018-08-09 02:58:44 +03:00
|
|
|
virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2018-03-31 20:50:10 +03:00
|
|
|
SVGAnimatedPathSegList* GetAnimPathSegList() override { return &mPath; }
|
|
|
|
|
2018-03-29 12:45:24 +03:00
|
|
|
nsStaticAtom* GetPathDataAttrName() const override { return nsGkAtoms::path; }
|
2018-03-31 20:50:10 +03:00
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
// WebIDL
|
2019-03-19 03:01:03 +03:00
|
|
|
already_AddRefed<DOMSVGAnimatedLength> StartOffset();
|
|
|
|
already_AddRefed<DOMSVGAnimatedEnumeration> Method();
|
|
|
|
already_AddRefed<DOMSVGAnimatedEnumeration> Spacing();
|
|
|
|
already_AddRefed<DOMSVGAnimatedEnumeration> Side();
|
|
|
|
already_AddRefed<DOMSVGAnimatedString> Href();
|
2013-01-03 00:24:07 +04:00
|
|
|
|
2018-08-15 23:32:04 +03:00
|
|
|
void HrefAsString(nsAString& aHref);
|
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
protected:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual LengthAttributesInfo GetLengthInfo() override;
|
|
|
|
virtual EnumAttributesInfo GetEnumInfo() override;
|
|
|
|
virtual StringAttributesInfo GetStringInfo() override;
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2013-07-24 04:01:35 +04:00
|
|
|
enum { /* TEXTLENGTH, */ STARTOFFSET = 1 };
|
2019-04-09 23:04:33 +03:00
|
|
|
SVGAnimatedLength mLengthAttributes[2];
|
|
|
|
virtual SVGAnimatedLength* LengthAttributes() override {
|
2013-07-24 04:01:35 +04:00
|
|
|
return mLengthAttributes;
|
|
|
|
}
|
|
|
|
static LengthInfo sLengthInfo[2];
|
|
|
|
|
2018-03-22 21:43:50 +03:00
|
|
|
enum { /* LENGTHADJUST, */ METHOD = 1, SPACING, SIDE };
|
2019-04-04 20:40:56 +03:00
|
|
|
SVGAnimatedEnumeration mEnumAttributes[4];
|
|
|
|
virtual SVGAnimatedEnumeration* EnumAttributes() override {
|
|
|
|
return mEnumAttributes;
|
|
|
|
}
|
2019-01-02 21:24:11 +03:00
|
|
|
static SVGEnumMapping sMethodMap[];
|
|
|
|
static SVGEnumMapping sSpacingMap[];
|
|
|
|
static SVGEnumMapping sSideMap[];
|
2018-03-22 21:43:50 +03:00
|
|
|
static EnumInfo sEnumInfo[4];
|
2007-12-04 09:51:36 +03:00
|
|
|
|
2016-07-07 06:44:25 +03:00
|
|
|
enum { HREF, XLINK_HREF };
|
2019-04-04 20:40:56 +03:00
|
|
|
SVGAnimatedString mStringAttributes[2];
|
2016-07-07 06:44:25 +03:00
|
|
|
static StringInfo sStringInfo[2];
|
2018-03-31 20:50:10 +03:00
|
|
|
|
|
|
|
SVGAnimatedPathSegList mPath;
|
2007-12-04 09:51:36 +03:00
|
|
|
};
|
|
|
|
|
2013-01-06 18:14:43 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2020-07-15 02:40:05 +03:00
|
|
|
#endif // DOM_SVG_SVGTEXTPATHELEMENT_H_
|