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/. */
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
#ifndef mozilla_dom_SVGAElement_h
|
|
|
|
#define mozilla_dom_SVGAElement_h
|
2010-05-27 00:01:10 +04:00
|
|
|
|
2012-01-26 13:57:21 +04:00
|
|
|
#include "Link.h"
|
2018-04-14 16:53:37 +03:00
|
|
|
#include "nsDOMTokenList.h"
|
2009-04-29 08:31:34 +04:00
|
|
|
#include "nsSVGString.h"
|
2013-01-10 09:30:13 +04:00
|
|
|
#include "mozilla/dom/SVGGraphicsElement.h"
|
2009-10-14 02:13:41 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
nsresult NS_NewSVGAElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
namespace mozilla {
|
2014-03-18 08:48:19 +04:00
|
|
|
|
2014-03-18 08:48:20 +04:00
|
|
|
class EventChainPostVisitor;
|
2014-03-18 08:48:19 +04:00
|
|
|
class EventChainPreVisitor;
|
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef SVGGraphicsElement SVGAElementBase;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGAElement final : public SVGAElementBase,
|
2015-03-27 21:52:19 +03:00
|
|
|
public Link
|
2009-04-29 08:31:34 +04:00
|
|
|
{
|
|
|
|
protected:
|
2018-04-14 16:53:37 +03:00
|
|
|
using Element::GetText;
|
|
|
|
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGAElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
|
2013-01-10 09:30:13 +04:00
|
|
|
friend nsresult (::NS_NewSVGAElement(nsIContent **aResult,
|
2014-06-20 06:01:40 +04:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2018-04-14 16:53:37 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGAElement, SVGAElementBase)
|
|
|
|
|
2009-04-29 08:31:34 +04:00
|
|
|
// nsINode interface methods
|
2018-04-05 20:42:41 +03:00
|
|
|
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
|
2014-03-18 08:48:20 +04:00
|
|
|
virtual nsresult PostHandleEvent(
|
2015-03-21 19:28:04 +03:00
|
|
|
EventChainPostVisitor& aVisitor) override;
|
2017-04-20 22:57:48 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
|
|
|
bool aPreallocateChildren) const override;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
|
|
|
// nsIContent
|
2009-11-23 21:48:52 +03:00
|
|
|
virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
|
2018-07-31 21:18:38 +03:00
|
|
|
nsIContent *aBindingParent) override;
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual void UnbindFromTree(bool aDeep = true,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aNullParent = true) override;
|
2017-10-03 01:05:19 +03:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
|
2016-09-28 05:21:50 +03:00
|
|
|
virtual int32_t TabIndexDefault() override;
|
|
|
|
virtual bool IsSVGFocusable(bool* aIsFocusable, int32_t* aTabIndex) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool IsLink(nsIURI** aURI) const override;
|
|
|
|
virtual void GetLinkTarget(nsAString& aTarget) override;
|
|
|
|
virtual already_AddRefed<nsIURI> GetHrefURI() const override;
|
|
|
|
virtual EventStates IntrinsicState() const override;
|
2018-01-03 22:21:22 +03:00
|
|
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
|
|
|
const nsAttrValue* aValue,
|
|
|
|
const nsAttrValue* aOldValue,
|
|
|
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
|
|
|
bool aNotify) override;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2017-05-06 22:32:14 +03:00
|
|
|
// Link
|
|
|
|
virtual bool ElementHasHref() const override;
|
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
// WebIDL
|
2013-06-15 02:37:27 +04:00
|
|
|
already_AddRefed<SVGAnimatedString> Href();
|
|
|
|
already_AddRefed<SVGAnimatedString> Target();
|
2018-04-14 16:53:37 +03:00
|
|
|
void GetDownload(nsAString& aDownload);
|
|
|
|
void SetDownload(const nsAString& aDownload, ErrorResult& rv);
|
|
|
|
void GetPing(nsAString& aPing);
|
|
|
|
void SetPing(const nsAString& aPing, mozilla::ErrorResult& rv);
|
|
|
|
void GetRel(nsAString& aRel);
|
|
|
|
void SetRel(const nsAString& aRel, mozilla::ErrorResult& rv);
|
|
|
|
void SetReferrerPolicy(const nsAString& aReferrerPolicy, mozilla::ErrorResult& rv);
|
|
|
|
void GetReferrerPolicy(nsAString& aReferrerPolicy);
|
|
|
|
nsDOMTokenList* RelList();
|
|
|
|
void GetHreflang(nsAString& aHreflang);
|
|
|
|
void SetHreflang(const nsAString& aHreflang, mozilla::ErrorResult& rv);
|
|
|
|
void GetType(nsAString& aType);
|
|
|
|
void SetType(const nsAString& aType, mozilla::ErrorResult& rv);
|
|
|
|
void GetText(nsAString& aText, mozilla::ErrorResult& rv);
|
|
|
|
void SetText(const nsAString& aText, mozilla::ErrorResult& rv);
|
2013-01-10 09:30:13 +04:00
|
|
|
|
2018-02-09 08:22:43 +03:00
|
|
|
void NodeInfoChanged(nsIDocument* aOldDoc) final
|
2017-04-15 18:55:05 +03:00
|
|
|
{
|
|
|
|
ClearHasPendingLinkUpdate();
|
|
|
|
SVGAElementBase::NodeInfoChanged(aOldDoc);
|
|
|
|
}
|
|
|
|
|
2009-04-29 08:31:34 +04:00
|
|
|
protected:
|
2014-07-09 01:23:16 +04:00
|
|
|
virtual ~SVGAElement();
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual StringAttributesInfo GetStringInfo() override;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
2016-06-28 12:22:30 +03:00
|
|
|
enum { HREF, XLINK_HREF, TARGET };
|
|
|
|
nsSVGString mStringAttributes[3];
|
|
|
|
static StringInfo sStringInfo[3];
|
2018-04-14 16:53:37 +03:00
|
|
|
|
|
|
|
RefPtr<nsDOMTokenList> mRelList;
|
|
|
|
static DOMTokenListSupportedToken sSupportedRelValues[];
|
2009-04-29 08:31:34 +04:00
|
|
|
};
|
2010-05-27 00:01:10 +04:00
|
|
|
|
2013-01-10 09:30:13 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGAElement_h
|