2006-02-21 00:33:27 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 12:12:37 +01: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 09:10:08 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-06-21 16:01:10 -07: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
|
|
|
|
2012-03-02 08:28:59 +00:00
|
|
|
class nsRenderingContext;
|
2008-09-18 21:47:21 +12: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
|
|
|
{
|
|
|
|
friend nsIFrame*
|
2009-01-19 13:31:34 -05:00
|
|
|
NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2006-02-21 00:33:27 +00:00
|
|
|
protected:
|
2006-03-26 21:30:36 +00:00
|
|
|
nsSVGForeignObjectFrame(nsStyleContext* aContext);
|
2009-09-12 17:49:24 +01:00
|
|
|
|
2009-01-09 11:35:24 -05:00
|
|
|
public:
|
2009-01-12 14:20:59 -05:00
|
|
|
NS_DECL_QUERYFRAME
|
2009-09-12 17:49:24 +01:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
2009-01-12 14:20:59 -05:00
|
|
|
|
2009-09-12 17:49:24 +01:00
|
|
|
// nsIFrame:
|
2013-03-19 21:47:48 -04:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
2013-05-29 12:37:49 -07:00
|
|
|
virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE;
|
2014-02-17 23:47:48 -08:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
2014-02-18 00:36:33 -08:00
|
|
|
nsIAtom* aAttribute,
|
|
|
|
int32_t aModType) MOZ_OVERRIDE;
|
2006-03-02 20:22:19 +00:00
|
|
|
|
2013-05-29 12:37:49 -07:00
|
|
|
virtual nsIFrame* GetContentInsertionFrame() MOZ_OVERRIDE {
|
2011-08-24 22:54:30 +02:00
|
|
|
return GetFirstPrincipalChild()->GetContentInsertionFrame();
|
2006-06-06 23:13:15 +00:00
|
|
|
}
|
|
|
|
|
2014-02-17 23:47:48 -08:00
|
|
|
virtual nsresult Reflow(nsPresContext* aPresContext,
|
2014-02-18 00:36:33 -08:00
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus) MOZ_OVERRIDE;
|
2007-01-26 06:58:31 +00:00
|
|
|
|
2013-02-15 00:12:27 +13:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
|
2012-07-20 14:12:29 -04: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 12:37:49 -07:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2007-02-24 18:33:33 +00:00
|
|
|
|
2013-05-29 12:37:49 -07: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 01:50:17 -05:00
|
|
|
virtual bool IsSVGTransformed(Matrix *aOwnTransform,
|
|
|
|
Matrix *aFromParentTransform) const MOZ_OVERRIDE;
|
2012-07-20 14:12:29 -04:00
|
|
|
|
2014-01-05 23:31:14 +00:00
|
|
|
#ifdef DEBUG_FRAME_DUMP
|
2014-02-17 23:47:48 -08: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:
|
2012-03-02 08:28:59 +00:00
|
|
|
NS_IMETHOD PaintSVG(nsRenderingContext *aContext,
|
2013-09-11 08:27:45 +01:00
|
|
|
const nsIntRect *aDirtyRect,
|
|
|
|
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
|
2012-09-14 09:10:08 -07:00
|
|
|
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE;
|
|
|
|
virtual void ReflowSVG() MOZ_OVERRIDE;
|
|
|
|
virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
|
2013-12-30 01:50:07 -05:00
|
|
|
virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace,
|
2012-09-14 09:10:08 -07:00
|
|
|
uint32_t aFlags) MOZ_OVERRIDE;
|
|
|
|
NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return true; }
|
2006-02-21 00:33:27 +00:00
|
|
|
|
2013-09-11 08:27:45 +01:00
|
|
|
gfxMatrix GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot = nullptr);
|
2007-11-20 01:10:18 -08:00
|
|
|
|
2012-08-29 17:39:33 +12: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 04:11:07 -07:00
|
|
|
void RequestReflow(nsIPresShell::IntrinsicDirty aType);
|
2009-06-18 13:31:25 +02:00
|
|
|
|
2007-06-25 01:31:31 -07:00
|
|
|
// If width or height is less than or equal to zero we must disable rendering
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsDisabled() const { return mRect.width <= 0 || mRect.height <= 0; }
|
2007-06-25 01:31:31 -07:00
|
|
|
|
2011-09-25 22:04:32 +01:00
|
|
|
nsAutoPtr<gfxMatrix> mCanvasTM;
|
2009-06-11 17:23:43 +02:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mInReflow;
|
2006-02-21 00:33:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|