2013-01-05 09:41:28 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=2 sw=2 et tw=78: */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_SVGScriptElement_h
|
|
|
|
#define mozilla_dom_SVGScriptElement_h
|
|
|
|
|
|
|
|
#include "nsSVGElement.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsSVGString.h"
|
|
|
|
#include "nsScriptElement.h"
|
|
|
|
|
2013-03-22 00:05:19 +00:00
|
|
|
class nsIDocument;
|
|
|
|
|
2013-01-05 09:41:28 +00:00
|
|
|
nsresult NS_NewSVGScriptElement(nsIContent **aResult,
|
2014-06-20 02:01:40 +00:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
2013-01-05 09:41:28 +00:00
|
|
|
mozilla::dom::FromParser aFromParser);
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef nsSVGElement SVGScriptElementBase;
|
|
|
|
|
|
|
|
class SVGScriptElement MOZ_FINAL : public SVGScriptElementBase,
|
|
|
|
public nsScriptElement
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
friend nsresult (::NS_NewSVGScriptElement(nsIContent **aResult,
|
2014-06-20 02:01:40 +00:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
2013-01-05 09:41:28 +00:00
|
|
|
mozilla::dom::FromParser aFromParser));
|
2014-06-20 02:01:40 +00:00
|
|
|
SVGScriptElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
|
2013-01-05 09:41:28 +00:00
|
|
|
FromParser aFromParser);
|
|
|
|
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
|
2013-01-05 09:41:28 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
// interfaces:
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// nsIScriptElement
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual void GetScriptType(nsAString& type) MOZ_OVERRIDE;
|
|
|
|
virtual void GetScriptText(nsAString& text) MOZ_OVERRIDE;
|
|
|
|
virtual void GetScriptCharset(nsAString& charset) MOZ_OVERRIDE;
|
|
|
|
virtual void FreezeUriAsyncDefer() MOZ_OVERRIDE;
|
|
|
|
virtual CORSMode GetCORSMode() const MOZ_OVERRIDE;
|
2013-02-02 20:23:18 +00:00
|
|
|
|
2013-01-05 09:41:28 +00:00
|
|
|
// nsScriptElement
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual bool HasScriptContent() MOZ_OVERRIDE;
|
2013-01-05 09:41:28 +00:00
|
|
|
|
|
|
|
// nsIContent specializations:
|
|
|
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|
|
|
nsIContent* aBindingParent,
|
2013-05-08 05:11:24 +00:00
|
|
|
bool aCompileEventHandlers) MOZ_OVERRIDE;
|
2013-01-05 09:41:28 +00:00
|
|
|
virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
2013-05-08 05:11:24 +00:00
|
|
|
const nsAttrValue* aValue, bool aNotify) MOZ_OVERRIDE;
|
2013-01-05 09:41:28 +00:00
|
|
|
virtual bool ParseAttribute(int32_t aNamespaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
const nsAString& aValue,
|
2013-05-08 05:11:24 +00:00
|
|
|
nsAttrValue& aResult) MOZ_OVERRIDE;
|
2013-01-05 09:41:28 +00:00
|
|
|
|
2014-06-20 02:01:40 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-01-05 09:41:28 +00:00
|
|
|
|
|
|
|
// WebIDL
|
2013-02-02 20:23:18 +00:00
|
|
|
void GetType(nsAString & aType);
|
|
|
|
void SetType(const nsAString & aType, ErrorResult& rv);
|
2014-09-06 02:42:33 +00:00
|
|
|
void GetCrossOrigin(nsAString & aCrossOrigin);
|
|
|
|
void SetCrossOrigin(const nsAString & aCrossOrigin, ErrorResult& aError);
|
2013-06-14 22:37:27 +00:00
|
|
|
already_AddRefed<SVGAnimatedString> Href();
|
2013-01-05 09:41:28 +00:00
|
|
|
|
|
|
|
protected:
|
2014-07-08 21:23:16 +00:00
|
|
|
~SVGScriptElement();
|
|
|
|
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual StringAttributesInfo GetStringInfo() MOZ_OVERRIDE;
|
2013-01-05 09:41:28 +00:00
|
|
|
|
|
|
|
enum { HREF };
|
|
|
|
nsSVGString mStringAttributes[1];
|
|
|
|
static StringInfo sStringInfo[1];
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGScriptElement_h
|