2006-02-21 00:33:27 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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/. */
|
2006-02-21 00:33:27 +00:00
|
|
|
|
|
|
|
#ifndef NSSVGFOREIGNOBJECTFRAME_H__
|
|
|
|
#define NSSVGFOREIGNOBJECTFRAME_H__
|
|
|
|
|
2012-09-14 16:10:08 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-06-21 23:01:10 +00:00
|
|
|
#include "nsContainerFrame.h"
|
2012-03-20 12:15:55 +00:00
|
|
|
#include "nsIPresShell.h"
|
2006-02-21 00:33:27 +00:00
|
|
|
#include "nsISVGChildFrame.h"
|
2006-06-15 03:23:56 +00:00
|
|
|
#include "nsRegion.h"
|
2012-03-20 12:15:55 +00:00
|
|
|
#include "nsSVGUtils.h"
|
2006-02-21 00:33:27 +00:00
|
|
|
|
2014-10-31 20:08:54 +00:00
|
|
|
class gfxContext;
|
2008-09-18 09:47:21 +00:00
|
|
|
class nsSVGOuterSVGFrame;
|
|
|
|
|
2006-06-06 23:13:15 +00:00
|
|
|
typedef nsContainerFrame nsSVGForeignObjectFrameBase;
|
2006-02-21 00:33:27 +00:00
|
|
|
|
|
|
|
class nsSVGForeignObjectFrame : public nsSVGForeignObjectFrameBase,
|
2007-02-05 20:04:17 +00:00
|
|
|
public nsISVGChildFrame
|
2006-02-21 00:33:27 +00:00
|
|
|
{
|
2014-05-24 22:20:40 +00:00
|
|
|
friend nsContainerFrame*
|
2009-01-19 18:31:34 +00:00
|
|
|
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2006-02-21 00:33:27 +00:00
|
|
|
protected:
|
2014-09-01 03:36:37 +00:00
|
|
|
explicit nsSVGForeignObjectFrame(nsStyleContext* aContext);
|
2009-09-12 16:49:24 +00:00
|
|
|
|
2009-01-09 16:35:24 +00:00
|
|
|
public:
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2009-01-12 19:20:59 +00:00
|
|
|
|
2009-09-12 16:49:24 +00:00
|
|
|
// nsIFrame:
|
2014-05-24 22:20:40 +00:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
2013-05-29 19:37:49 +00:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
2014-02-18 08:36:33 +00:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2006-03-02 20:22:19 +00:00
|
|
|
|
2014-05-24 22:20:39 +00:00
|
|
|
virtual nsContainerFrame* GetContentInsertionFrame() MOZ_OVERRIDE {
|
2011-08-24 20:54:30 +00:00
|
|
|
return GetFirstPrincipalChild()->GetContentInsertionFrame();
|
2006-06-06 23:13:15 +00:00
|
|
|
}
|
|
|
|
|
2014-05-13 00:47:52 +00:00
|
|
|
virtual void Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2007-01-26 06:58:31 +00:00
|
|
|
|
2013-02-14 11:12:27 +00:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2012-07-20 18:12:29 +00:00
|
|
|
|
2006-02-21 00:33:27 +00:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
2007-01-30 00:06:41 +00:00
|
|
|
* @see nsGkAtoms::svgForeignObjectFrame
|
2006-02-21 00:33:27 +00:00
|
|
|
*/
|
2013-05-29 19:37:49 +00:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2007-02-24 18:33:33 +00:00
|
|
|
|
2013-05-29 19:37:49 +00:00
|
|
|
virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
|
2007-02-24 18:33:33 +00:00
|
|
|
{
|
|
|
|
return nsSVGForeignObjectFrameBase::IsFrameOfType(aFlags &
|
|
|
|
~(nsIFrame::eSVG | nsIFrame::eSVGForeignObject));
|
|
|
|
}
|
2006-02-21 00:33:27 +00:00
|
|
|
|
2013-12-30 06:50:17 +00:00
|
|
|
virtual bool IsSVGTransformed(Matrix *aOwnTransform,
|
|
|
|
Matrix *aFromParentTransform) const MOZ_OVERRIDE;
|
2012-07-20 18:12:29 +00:00
|
|
|
|
2014-01-05 23:31:14 +00:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-18 07:47:48 +00:00
|
|
|
virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE
|
2006-02-21 00:33:27 +00:00
|
|
|
{
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("SVGForeignObject"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// nsISVGChildFrame interface:
|
2014-10-31 20:08:54 +00:00
|
|
|
virtual nsresult PaintSVG(gfxContext& aContext,
|
2014-08-29 19:42:07 +00:00
|
|
|
const gfxMatrix& aTransform,
|
|
|
|
const nsIntRect* aDirtyRect = nullptr) MOZ_OVERRIDE;
|
2014-08-07 07:09:31 +00:00
|
|
|
virtual nsIFrame* GetFrameForPoint(const gfxPoint& aPoint) MOZ_OVERRIDE;
|
2014-02-19 22:34:31 +00:00
|
|
|
virtual nsRect GetCoveredRegion() MOZ_OVERRIDE;
|
2012-09-14 16:10:08 +00:00
|
|
|
virtual void ReflowSVG() MOZ_OVERRIDE;
|
|
|
|
virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
|
2013-12-30 06:50:07 +00:00
|
|
|
virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace,
|
2012-09-14 16:10:08 +00:00
|
|
|
uint32_t aFlags) MOZ_OVERRIDE;
|
2014-02-19 22:34:31 +00:00
|
|
|
virtual bool IsDisplayContainer() MOZ_OVERRIDE { return true; }
|
2006-02-21 00:33:27 +00:00
|
|
|
|
2014-09-08 11:28:50 +00:00
|
|
|
gfxMatrix GetCanvasTM();
|
2007-11-20 09:10:18 +00:00
|
|
|
|
2012-08-29 05:39:33 +00:00
|
|
|
nsRect GetInvalidRegion();
|
|
|
|
|
2006-02-21 00:33:27 +00:00
|
|
|
protected:
|
|
|
|
// implementation helpers:
|
2006-06-09 18:08:33 +00:00
|
|
|
void DoReflow();
|
2007-05-05 11:11:07 +00:00
|
|
|
void RequestReflow(nsIPresShell::IntrinsicDirty aType);
|
2009-06-18 11:31:25 +00:00
|
|
|
|
2007-06-25 08:31:31 +00:00
|
|
|
// If width or height is less than or equal to zero we must disable rendering
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsDisabled() const { return mRect.width <= 0 || mRect.height <= 0; }
|
2007-06-25 08:31:31 +00:00
|
|
|
|
2011-09-25 21:04:32 +00:00
|
|
|
nsAutoPtr<gfxMatrix> mCanvasTM;
|
2009-06-11 15:23:43 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mInReflow;
|
2006-02-21 00:33:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|