2009-04-24 16:17:43 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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-24 16:17:43 -07:00
|
|
|
|
2013-11-18 06:29:47 -08:00
|
|
|
#ifndef __NS_SVGINNERSVGFRAME_H__
|
|
|
|
#define __NS_SVGINNERSVGFRAME_H__
|
|
|
|
|
2013-05-14 09:33:23 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2009-04-24 16:17:43 -07:00
|
|
|
#include "nsSVGContainerFrame.h"
|
|
|
|
#include "nsISVGSVGFrame.h"
|
|
|
|
|
2014-10-31 13:08:54 -07:00
|
|
|
class gfxContext;
|
2012-03-02 00:28:59 -08:00
|
|
|
|
2009-04-24 16:17:43 -07:00
|
|
|
typedef nsSVGDisplayContainerFrame nsSVGInnerSVGFrameBase;
|
|
|
|
|
|
|
|
class nsSVGInnerSVGFrame : public nsSVGInnerSVGFrameBase,
|
|
|
|
public nsISVGSVGFrame
|
|
|
|
{
|
|
|
|
friend nsIFrame*
|
|
|
|
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
|
|
|
protected:
|
2014-08-31 20:36:37 -07:00
|
|
|
explicit nsSVGInnerSVGFrame(nsStyleContext* aContext) :
|
2009-04-24 16:17:43 -07:00
|
|
|
nsSVGInnerSVGFrameBase(aContext) {}
|
|
|
|
|
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_QUERYFRAME_TARGET(nsSVGInnerSVGFrame)
|
2009-04-24 16:17:43 -07:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2009-04-24 16:17:43 -07:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
2014-05-24 15:20:40 -07:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
2015-03-21 09:28:04 -07:00
|
|
|
nsIFrame* aPrevInFlow) override;
|
2009-04-24 16:17:43 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsGkAtoms::svgInnerSVGFrame
|
|
|
|
*/
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsIAtom* GetType() const override;
|
2009-04-24 16:17:43 -07:00
|
|
|
|
2014-01-05 15:31:14 -08:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const override
|
2009-04-24 16:17:43 -07:00
|
|
|
{
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("SVGInnerSVG"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-02-17 23:47:48 -08:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
2014-02-18 00:36:33 -08:00
|
|
|
nsIAtom* aAttribute,
|
2015-03-21 09:28:04 -07:00
|
|
|
int32_t aModType) override;
|
2010-10-07 12:19:32 -07:00
|
|
|
|
2009-04-24 16:17:43 -07:00
|
|
|
// nsISVGChildFrame interface:
|
2014-10-31 13:08:54 -07:00
|
|
|
virtual nsresult PaintSVG(gfxContext& aContext,
|
2014-08-29 12:42:07 -07:00
|
|
|
const gfxMatrix& aTransform,
|
2015-03-21 09:28:04 -07:00
|
|
|
const nsIntRect *aDirtyRect = nullptr) override;
|
|
|
|
virtual nsRect GetCoveredRegion() override;
|
|
|
|
virtual void ReflowSVG() override;
|
|
|
|
virtual void NotifySVGChanged(uint32_t aFlags) override;
|
|
|
|
virtual nsIFrame* GetFrameForPoint(const gfxPoint& aPoint) override;
|
2009-04-24 16:17:43 -07:00
|
|
|
|
|
|
|
// nsSVGContainerFrame methods:
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual gfxMatrix GetCanvasTM() override;
|
2009-04-24 16:17:43 -07:00
|
|
|
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual bool HasChildrenOnlyTransform(Matrix *aTransform) const override;
|
2012-05-16 21:05:09 -07:00
|
|
|
|
2009-04-24 16:17:43 -07:00
|
|
|
// nsISVGSVGFrame interface:
|
2015-03-21 09:28:04 -07:00
|
|
|
virtual void NotifyViewportOrTransformChanged(uint32_t aFlags) override;
|
2009-04-24 16:17:43 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2011-09-25 14:04:32 -07:00
|
|
|
nsAutoPtr<gfxMatrix> mCanvasTM;
|
2009-04-24 16:17:43 -07:00
|
|
|
};
|
2013-11-18 06:29:47 -08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|