2015-05-03 19:32:37 +00: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 11:12:37 +00: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 04:31:34 +00:00
|
|
|
|
2013-01-10 05:30:13 +00:00
|
|
|
#ifndef mozilla_dom_SVGAElement_h
|
|
|
|
#define mozilla_dom_SVGAElement_h
|
2010-05-26 20:01:10 +00:00
|
|
|
|
2012-01-26 09:57:21 +00:00
|
|
|
#include "Link.h"
|
2018-04-14 13:53:37 +00:00
|
|
|
#include "nsDOMTokenList.h"
|
2019-04-04 17:40:56 +00:00
|
|
|
#include "SVGAnimatedString.h"
|
2013-01-10 05:30:13 +00:00
|
|
|
#include "mozilla/dom/SVGGraphicsElement.h"
|
2009-10-13 22:13:41 +00:00
|
|
|
|
2013-01-10 05:30:13 +00:00
|
|
|
nsresult NS_NewSVGAElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2009-04-29 04:31:34 +00:00
|
|
|
|
2013-01-10 05:30:13 +00:00
|
|
|
namespace mozilla {
|
2014-03-18 04:48:19 +00:00
|
|
|
|
2014-03-18 04:48:20 +00:00
|
|
|
class EventChainPostVisitor;
|
2014-03-18 04:48:19 +00:00
|
|
|
class EventChainPreVisitor;
|
|
|
|
|
2013-01-10 05:30:13 +00:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef SVGGraphicsElement SVGAElementBase;
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class SVGAElement final : public SVGAElementBase, public Link {
|
2009-04-29 04:31:34 +00:00
|
|
|
protected:
|
2018-04-14 13:53:37 +00:00
|
|
|
using Element::GetText;
|
|
|
|
|
2018-09-21 20:45:49 +00:00
|
|
|
explicit SVGAElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-01-10 05:30:13 +00:00
|
|
|
friend nsresult(::NS_NewSVGAElement(
|
|
|
|
nsIContent** aResult,
|
2014-06-20 02:01:40 +00:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext* cx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
2009-04-29 04:31:34 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
2018-04-14 13:53:37 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SVGAElement, SVGAElementBase)
|
|
|
|
|
2009-04-29 04:31:34 +00:00
|
|
|
// nsINode interface methods
|
2018-04-05 17:42:41 +00:00
|
|
|
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
|
2019-04-02 19:06:11 +00:00
|
|
|
MOZ_CAN_RUN_SCRIPT
|
|
|
|
nsresult PostHandleEvent(EventChainPostVisitor& aVisitor) override;
|
2018-08-08 23:58:44 +00:00
|
|
|
virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
2009-04-29 04:31:34 +00:00
|
|
|
|
|
|
|
// nsIContent
|
2019-01-02 13:05:23 +00:00
|
|
|
virtual nsresult BindToTree(Document* aDocument, nsIContent* aParent,
|
2018-07-31 18:18:38 +00:00
|
|
|
nsIContent* aBindingParent) override;
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual void UnbindFromTree(bool aDeep = true,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aNullParent = true) override;
|
2017-10-02 22:05:19 +00:00
|
|
|
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
|
2016-09-28 02:21:50 +00:00
|
|
|
virtual int32_t TabIndexDefault() override;
|
2018-12-19 09:41:11 +00:00
|
|
|
bool IsFocusableInternal(int32_t* aTabIndex, bool aWithMouse) override;
|
2015-03-21 16:28:04 +00: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 19:21:22 +00:00
|
|
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
|
|
|
const nsAttrValue* aValue,
|
|
|
|
const nsAttrValue* aOldValue,
|
|
|
|
nsIPrincipal* aMaybeScriptedPrincipal,
|
|
|
|
bool aNotify) override;
|
2009-04-29 04:31:34 +00:00
|
|
|
|
2017-05-06 19:32:14 +00:00
|
|
|
// Link
|
|
|
|
virtual bool ElementHasHref() const override;
|
|
|
|
|
2013-01-10 05:30:13 +00:00
|
|
|
// WebIDL
|
2019-03-19 00:01:03 +00:00
|
|
|
already_AddRefed<DOMSVGAnimatedString> Href();
|
|
|
|
already_AddRefed<DOMSVGAnimatedString> Target();
|
2018-04-14 13:53:37 +00: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);
|
2019-04-27 07:57:50 +00:00
|
|
|
void SetReferrerPolicy(const nsAString& aPolicy, mozilla::ErrorResult& rv);
|
|
|
|
void GetReferrerPolicy(nsAString& aPolicy);
|
2018-04-14 13:53:37 +00:00
|
|
|
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 05:30:13 +00:00
|
|
|
|
2019-01-02 13:05:23 +00:00
|
|
|
void NodeInfoChanged(Document* aOldDoc) final {
|
2017-04-15 15:55:05 +00:00
|
|
|
ClearHasPendingLinkUpdate();
|
|
|
|
SVGAElementBase::NodeInfoChanged(aOldDoc);
|
|
|
|
}
|
|
|
|
|
2009-04-29 04:31:34 +00:00
|
|
|
protected:
|
2019-04-17 22:38:02 +00:00
|
|
|
virtual ~SVGAElement() = default;
|
2009-04-29 04:31:34 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual StringAttributesInfo GetStringInfo() override;
|
2009-04-29 04:31:34 +00:00
|
|
|
|
2016-06-28 09:22:30 +00:00
|
|
|
enum { HREF, XLINK_HREF, TARGET };
|
2019-04-04 17:40:56 +00:00
|
|
|
SVGAnimatedString mStringAttributes[3];
|
2016-06-28 09:22:30 +00:00
|
|
|
static StringInfo sStringInfo[3];
|
2018-04-14 13:53:37 +00:00
|
|
|
|
|
|
|
RefPtr<nsDOMTokenList> mRelList;
|
|
|
|
static DOMTokenListSupportedToken sSupportedRelValues[];
|
2009-04-29 04:31:34 +00:00
|
|
|
};
|
2010-05-26 20:01:10 +00:00
|
|
|
|
2013-01-10 05:30:13 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGAElement_h
|