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"
|
2009-04-29 04:31:34 +00:00
|
|
|
#include "nsSVGString.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(nsIContent **aResult,
|
2014-06-20 02:01:40 +00:00
|
|
|
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,
|
2015-03-27 18:52:19 +00:00
|
|
|
public Link
|
2009-04-29 04:31:34 +00:00
|
|
|
{
|
|
|
|
protected:
|
2014-09-01 01:08:04 +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
|
|
|
|
|
|
|
|
// nsINode interface methods
|
2016-10-21 02:11:07 +00:00
|
|
|
virtual nsresult GetEventTargetParent(
|
|
|
|
EventChainPreVisitor& aVisitor) override;
|
2014-03-18 04:48:20 +00:00
|
|
|
virtual nsresult PostHandleEvent(
|
2015-03-21 16:28:04 +00:00
|
|
|
EventChainPostVisitor& aVisitor) override;
|
2017-04-20 19:57:48 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
|
|
|
|
bool aPreallocateChildren) const override;
|
2009-04-29 04:31:34 +00:00
|
|
|
|
|
|
|
// nsIContent
|
2009-11-23 18:48:52 +00:00
|
|
|
virtual nsresult BindToTree(nsIDocument *aDocument, nsIContent *aParent,
|
|
|
|
nsIContent *aBindingParent,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aCompileEventHandlers) 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;
|
|
|
|
virtual bool IsSVGFocusable(bool* aIsFocusable, int32_t* aTabIndex) 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;
|
2017-10-09 21:33:38 +00:00
|
|
|
using nsIContent::SetAttr;
|
2017-10-02 22:05:19 +00:00
|
|
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
|
|
|
nsAtom* aPrefix, const nsAString& aValue,
|
2017-10-09 21:33:38 +00:00
|
|
|
nsIPrincipal* aSubjectPrincipal,
|
2015-03-21 16:28:04 +00:00
|
|
|
bool aNotify) override;
|
2017-10-02 22:05:19 +00:00
|
|
|
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsAtom* aAttribute,
|
2015-03-21 16:28:04 +00:00
|
|
|
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
|
2013-06-14 22:37:27 +00:00
|
|
|
already_AddRefed<SVGAnimatedString> Href();
|
|
|
|
already_AddRefed<SVGAnimatedString> Target();
|
2013-02-18 22:48:53 +00:00
|
|
|
void GetDownload(nsAString & aDownload);
|
|
|
|
void SetDownload(const nsAString & aDownload, ErrorResult& rv);
|
2013-01-10 05:30:13 +00:00
|
|
|
|
2017-04-15 15:55:05 +00:00
|
|
|
virtual void NodeInfoChanged(nsIDocument* aOldDoc) final override
|
|
|
|
{
|
|
|
|
ClearHasPendingLinkUpdate();
|
|
|
|
SVGAElementBase::NodeInfoChanged(aOldDoc);
|
|
|
|
}
|
|
|
|
|
2009-04-29 04:31:34 +00:00
|
|
|
protected:
|
2014-07-08 21:23:16 +00:00
|
|
|
virtual ~SVGAElement();
|
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 };
|
|
|
|
nsSVGString mStringAttributes[3];
|
|
|
|
static StringInfo sStringInfo[3];
|
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
|