2005-09-07 02:30:40 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2005-09-07 02:30:40 +04:00
|
|
|
|
|
|
|
#ifndef __NS_SVGFILTERFRAME_H__
|
|
|
|
#define __NS_SVGFILTERFRAME_H__
|
|
|
|
|
2013-05-29 23:37:49 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-03-20 16:15:55 +04:00
|
|
|
#include "nsFrame.h"
|
|
|
|
#include "nsQueryFrame.h"
|
2007-03-29 12:54:53 +04:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-18 14:32:02 +04:00
|
|
|
#include "nsSVGUtils.h"
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2012-03-20 16:15:55 +04:00
|
|
|
class nsIAtom;
|
|
|
|
class nsIContent;
|
|
|
|
class nsIFrame;
|
|
|
|
class nsIPresShell;
|
|
|
|
class nsStyleContext;
|
2012-03-28 15:31:47 +04:00
|
|
|
class nsSVGLength2;
|
2008-02-18 05:04:26 +03:00
|
|
|
|
2013-09-07 06:15:49 +04:00
|
|
|
struct nsRect;
|
|
|
|
|
2013-02-18 03:28:47 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class SVGFilterElement;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2013-02-18 03:28:47 +04:00
|
|
|
|
2008-02-18 10:29:00 +03:00
|
|
|
typedef nsSVGContainerFrame nsSVGFilterFrameBase;
|
2012-03-20 16:15:55 +04:00
|
|
|
|
2007-03-29 12:54:53 +04:00
|
|
|
class nsSVGFilterFrame : public nsSVGFilterFrameBase
|
|
|
|
{
|
|
|
|
friend nsIFrame*
|
2009-01-19 21:31:34 +03:00
|
|
|
NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
|
2007-09-07 13:30:51 +04:00
|
|
|
protected:
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit nsSVGFilterFrame(nsStyleContext* aContext)
|
2012-03-28 15:31:47 +04:00
|
|
|
: nsSVGFilterFrameBase(aContext),
|
|
|
|
mLoopFlag(false),
|
|
|
|
mNoHRefURI(false)
|
2012-03-10 23:28:06 +04:00
|
|
|
{
|
2013-07-12 11:13:07 +04:00
|
|
|
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
2012-03-10 23:28:06 +04:00
|
|
|
}
|
2005-09-07 02:30:40 +04:00
|
|
|
|
2008-09-11 04:24:16 +04:00
|
|
|
public:
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_DECL_FRAMEARENA_HELPERS
|
|
|
|
|
2012-07-20 20:41:29 +04:00
|
|
|
// nsIFrame methods:
|
2013-02-14 15:12:27 +04:00
|
|
|
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsDisplayListSet& aLists) override {}
|
2012-07-20 20:41:29 +04:00
|
|
|
|
2014-02-18 11:47:48 +04:00
|
|
|
virtual nsresult AttributeChanged(int32_t aNameSpaceID,
|
2014-02-18 12:36:33 +04:00
|
|
|
nsIAtom* aAttribute,
|
2015-03-21 19:28:04 +03:00
|
|
|
int32_t aModType) override;
|
2011-10-09 21:17:29 +04:00
|
|
|
|
2009-01-19 21:31:34 +03:00
|
|
|
#ifdef DEBUG
|
2014-05-25 02:20:40 +04:00
|
|
|
virtual void Init(nsIContent* aContent,
|
|
|
|
nsContainerFrame* aParent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsIFrame* aPrevInFlow) override;
|
2009-01-19 21:31:34 +03:00
|
|
|
#endif
|
|
|
|
|
2007-03-29 12:54:53 +04:00
|
|
|
/**
|
|
|
|
* Get the "type" of the frame
|
|
|
|
*
|
|
|
|
* @see nsGkAtoms::svgFilterFrame
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsIAtom* GetType() const override;
|
2012-03-28 15:31:47 +04: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-06 02:04:42 +04:00
|
|
|
friend class nsSVGFilterInstance;
|
2012-03-28 15:31:47 +04:00
|
|
|
nsSVGFilterFrame* GetReferencedFilter();
|
|
|
|
nsSVGFilterFrame* GetReferencedFilterIfNotInUse();
|
|
|
|
|
|
|
|
// Accessors to lookup filter attributes
|
2012-08-22 19:56:38 +04:00
|
|
|
uint16_t GetEnumValue(uint32_t aIndex, nsIContent *aDefault);
|
|
|
|
uint16_t GetEnumValue(uint32_t aIndex)
|
2012-03-28 15:31:47 +04:00
|
|
|
{
|
|
|
|
return GetEnumValue(aIndex, mContent);
|
|
|
|
}
|
2012-08-22 19:56:38 +04:00
|
|
|
const nsSVGLength2 *GetLengthValue(uint32_t aIndex, nsIContent *aDefault);
|
|
|
|
const nsSVGLength2 *GetLengthValue(uint32_t aIndex)
|
2012-03-28 15:31:47 +04:00
|
|
|
{
|
|
|
|
return GetLengthValue(aIndex, mContent);
|
|
|
|
}
|
2013-02-18 03:28:47 +04:00
|
|
|
const mozilla::dom::SVGFilterElement *GetFilterContent(nsIContent *aDefault);
|
|
|
|
const mozilla::dom::SVGFilterElement *GetFilterContent()
|
2012-03-28 15:31:47 +04:00
|
|
|
{
|
|
|
|
return GetFilterContent(mContent);
|
|
|
|
}
|
|
|
|
|
|
|
|
// This flag is used to detect loops in xlink:href processing
|
|
|
|
bool mLoopFlag;
|
|
|
|
bool mNoHRefURI;
|
2007-03-29 12:54:53 +04:00
|
|
|
};
|
2005-11-11 17:36:26 +03:00
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
#endif
|