2007-03-22 10:30:00 -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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef __NS_SVGFILTERFRAME_H__
|
|
|
|
#define __NS_SVGFILTERFRAME_H__
|
|
|
|
|
2013-05-29 12:37:49 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-03-20 05:15:55 -07:00
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsQueryFrame.h"
|
2007-03-29 01:54:53 -07:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-18 03:32:02 -07:00
|
|
|
#include "nsSVGUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-03-20 05:15:55 -07:00
|
|
|
class nsIAtom;
|
|
|
|
class nsIContent;
|
|
|
|
class nsIFrame;
|
|
|
|
class nsIPresShell;
|
2012-03-02 00:28:59 -08:00
|
|
|
class nsRenderingContext;
|
2012-03-20 05:15:55 -07:00
|
|
|
class nsStyleContext;
|
2008-09-10 17:24:16 -07:00
|
|
|
class nsSVGFilterPaintCallback;
|
2012-03-28 04:31:47 -07:00
|
|
|
class nsSVGIntegerPair;
|
|
|
|
class nsSVGLength2;
|
2008-02-17 18:04:26 -08:00
|
|
|
|
2013-09-06 19:15:49 -07:00
|
|
|
struct nsRect;
|
|
|
|
|
2013-02-17 15:28:47 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class SVGFilterElement;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-17 23:29:00 -08:00
|
|
|
typedef nsSVGContainerFrame nsSVGFilterFrameBase;
|
2012-03-20 05:15:55 -07:00
|
|
|
|
2007-03-29 01:54:53 -07:00
|
|
|
class nsSVGFilterFrame : public nsSVGFilterFrameBase
|
|
|
|
{
|
|
|
|
friend nsIFrame*
|
2009-01-19 10:31:34 -08:00
|
|
|
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-09-07 02:30:51 -07:00
|
|
|
protected:
|
2012-03-10 11:28:06 -08:00
|
|
|
nsSVGFilterFrame(nsStyleContext* aContext)
|
2012-03-28 04:31:47 -07:00
|
|
|
: nsSVGFilterFrameBase(aContext),
|
|
|
|
mLoopFlag(false),
|
|
|
|
mNoHRefURI(false)
|
2012-03-10 11:28:06 -08:00
|
|
|
{
|
2013-07-12 00:13:07 -07:00
|
|
|
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
2012-03-10 11:28:06 -08:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-09-10 17:24:16 -07:00
|
|
|
public:
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2012-07-20 09:41:29 -07:00
|
|
|
// nsIFrame methods:
|
2013-02-14 03:12:27 -08:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
|
2012-07-20 09:41:29 -07:00
|
|
|
|
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;
|
2011-10-09 10:17:29 -07:00
|
|
|
|
2009-01-19 10:31:34 -08:00
|
|
|
#ifdef DEBUG
|
2014-05-24 15:20:40 -07:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
|
2009-01-19 10:31:34 -08:00
|
|
|
#endif
|
|
|
|
|
2007-03-29 01:54:53 -07:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsGkAtoms::svgFilterFrame
|
|
|
|
*/
|
2013-05-29 12:37:49 -07:00
|
|
|
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
|
2012-03-28 04:31:47 -07:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Parse our xlink:href and set up our nsSVGPaintingProperty if we
|
|
|
|
// reference another filter and we don't have a property. Return
|
|
|
|
// the referenced filter's frame if available, null otherwise.
|
|
|
|
class AutoFilterReferencer;
|
2014-02-05 14:04:42 -08:00
|
|
|
friend class nsSVGFilterInstance;
|
2012-03-28 04:31:47 -07:00
|
|
|
nsSVGFilterFrame* GetReferencedFilter();
|
|
|
|
nsSVGFilterFrame* GetReferencedFilterIfNotInUse();
|
|
|
|
|
|
|
|
// Accessors to lookup filter attributes
|
2012-08-22 08:56:38 -07:00
|
|
|
uint16_t GetEnumValue(uint32_t aIndex, nsIContent *aDefault);
|
|
|
|
uint16_t GetEnumValue(uint32_t aIndex)
|
2012-03-28 04:31:47 -07:00
|
|
|
{
|
|
|
|
return GetEnumValue(aIndex, mContent);
|
|
|
|
}
|
2012-08-22 08:56:38 -07:00
|
|
|
const nsSVGLength2 *GetLengthValue(uint32_t aIndex, nsIContent *aDefault);
|
|
|
|
const nsSVGLength2 *GetLengthValue(uint32_t aIndex)
|
2012-03-28 04:31:47 -07:00
|
|
|
{
|
|
|
|
return GetLengthValue(aIndex, mContent);
|
|
|
|
}
|
2013-02-17 15:28:47 -08:00
|
|
|
const mozilla::dom::SVGFilterElement *GetFilterContent(nsIContent *aDefault);
|
|
|
|
const mozilla::dom::SVGFilterElement *GetFilterContent()
|
2012-03-28 04:31:47 -07:00
|
|
|
{
|
|
|
|
return GetFilterContent(mContent);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This flag is used to detect loops in xlink:href processing
|
|
|
|
bool mLoopFlag;
|
|
|
|
bool mNoHRefURI;
|
2007-03-29 01:54:53 -07:00
|
|
|
};
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#endif
|