2014-02-17 17:24:40 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#include "mozilla/dom/DOMString.h"
|
|
|
|
#include "mozilla/dom/FromParser.h"
|
|
|
|
#include "mozilla/dom/SVGGraphicsElement.h"
|
|
|
|
#include "nsContentUtils.h"
|
|
|
|
#include "nsDOMSettableTokenList.h"
|
|
|
|
#include "nsFrameLoader.h"
|
|
|
|
#include "nsElementFrameLoaderOwner.h"
|
|
|
|
#include "nsIDOMDocument.h"
|
|
|
|
#include "nsIDOMEventListener.h"
|
|
|
|
#include "nsIFrameLoader.h"
|
|
|
|
#include "nsIWebNavigation.h"
|
|
|
|
#include "nsSVGElement.h"
|
|
|
|
#include "nsSVGLength2.h"
|
|
|
|
#include "SVGAnimatedPreserveAspectRatio.h"
|
|
|
|
|
|
|
|
nsresult NS_NewSVGIFrameElement(nsIContent **aResult,
|
2014-06-19 19:01:40 -07:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
2014-02-17 17:24:40 -08:00
|
|
|
mozilla::dom::FromParser aFromParser);
|
|
|
|
|
|
|
|
typedef mozilla::dom::SVGGraphicsElement SVGIFrameElementBase;
|
|
|
|
|
2014-08-18 07:44:50 -07:00
|
|
|
class nsIDocument;
|
2014-02-17 17:24:40 -08:00
|
|
|
class nsSVGIFrameFrame;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class DOMSVGAnimatedPreserveAspectRatio;
|
|
|
|
|
|
|
|
class SVGIFrameElement MOZ_FINAL : public SVGIFrameElementBase,
|
|
|
|
public nsElementFrameLoaderOwner
|
|
|
|
{
|
|
|
|
friend class ::nsSVGIFrameFrame;
|
|
|
|
friend nsresult (::NS_NewSVGIFrameElement(nsIContent **aResult,
|
2014-06-19 19:01:40 -07:00
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
2014-02-17 17:24:40 -08:00
|
|
|
mozilla::dom::FromParser aFromParser));
|
|
|
|
|
2014-06-19 19:01:40 -07:00
|
|
|
SVGIFrameElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
|
2014-02-17 17:24:40 -08:00
|
|
|
mozilla::dom::FromParser aFromParser);
|
|
|
|
virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
|
|
|
|
|
2014-07-08 14:23:16 -07:00
|
|
|
~SVGIFrameElement();
|
|
|
|
|
2014-02-17 17:24:40 -08:00
|
|
|
public:
|
|
|
|
// interface
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
// nsSVGElement specializations:
|
|
|
|
virtual gfxMatrix PrependLocalTransformsTo(const gfxMatrix &aMatrix,
|
|
|
|
TransformTypes aWhich = eAllTransforms) const MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
// nsIContent
|
|
|
|
virtual bool ParseAttribute(int32_t aNamespaceID,
|
|
|
|
nsIAtom* aAttribute,
|
|
|
|
const nsAString& aValue,
|
|
|
|
nsAttrValue& aResult) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|
|
|
nsIContent* aBindingParent,
|
|
|
|
bool aCompileEventHandlers) MOZ_OVERRIDE;
|
|
|
|
virtual void UnbindFromTree(bool aDeep = true,
|
|
|
|
bool aNullParent = true) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
|
|
nsIAtom* aPrefix, const nsAString& aValue,
|
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|
|
|
const nsAttrValue* aValue,
|
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
|
|
|
virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void DestroyContent() MOZ_OVERRIDE;
|
|
|
|
nsresult CopyInnerTo(mozilla::dom::Element* aDest);
|
2014-06-19 19:01:40 -07:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2014-02-17 17:24:40 -08:00
|
|
|
|
|
|
|
// WebIDL
|
|
|
|
already_AddRefed<SVGAnimatedLength> X();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Y();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Width();
|
|
|
|
already_AddRefed<SVGAnimatedLength> Height();
|
|
|
|
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
|
|
|
|
void GetName(DOMString& name);
|
|
|
|
void GetSrc(DOMString& src);
|
|
|
|
void GetSrcdoc(DOMString& srcdoc);
|
2014-05-15 02:05:42 -07:00
|
|
|
nsDOMSettableTokenList* Sandbox();
|
2014-02-17 17:24:40 -08:00
|
|
|
using nsElementFrameLoaderOwner::GetContentDocument;
|
|
|
|
using nsElementFrameLoaderOwner::GetContentWindow;
|
|
|
|
|
|
|
|
// Parses a sandbox attribute and converts it to the set of flags used internally.
|
|
|
|
// Returns 0 if there isn't the attribute.
|
|
|
|
uint32_t GetSandboxFlags();
|
|
|
|
|
|
|
|
private:
|
2015-01-01 22:13:59 -08:00
|
|
|
virtual LengthAttributesInfo GetLengthInfo() MOZ_OVERRIDE;
|
|
|
|
virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() MOZ_OVERRIDE;
|
2014-02-17 17:24:40 -08:00
|
|
|
virtual mozilla::dom::Element* ThisFrameElement() MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
|
|
|
|
nsSVGLength2 mLengthAttributes[4];
|
|
|
|
static LengthInfo sLengthInfo[4];
|
|
|
|
|
|
|
|
SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|