michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // Keep in (case-insensitive) order: michael@0: #include "nsFrame.h" michael@0: #include "nsGkAtoms.h" michael@0: #include "nsSVGEffects.h" michael@0: #include "nsSVGFilters.h" michael@0: michael@0: typedef nsFrame SVGFEUnstyledLeafFrameBase; michael@0: michael@0: class SVGFEUnstyledLeafFrame : public SVGFEUnstyledLeafFrameBase michael@0: { michael@0: friend nsIFrame* michael@0: NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); michael@0: protected: michael@0: SVGFEUnstyledLeafFrame(nsStyleContext* aContext) michael@0: : SVGFEUnstyledLeafFrameBase(aContext) michael@0: { michael@0: AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY); michael@0: } michael@0: michael@0: public: michael@0: NS_DECL_FRAMEARENA_HELPERS michael@0: michael@0: virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, michael@0: const nsRect& aDirtyRect, michael@0: const nsDisplayListSet& aLists) MOZ_OVERRIDE {} michael@0: michael@0: virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE michael@0: { michael@0: return SVGFEUnstyledLeafFrameBase::IsFrameOfType(aFlags & ~(nsIFrame::eSVG)); michael@0: } michael@0: michael@0: #ifdef DEBUG_FRAME_DUMP michael@0: virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE michael@0: { michael@0: return MakeFrameName(NS_LITERAL_STRING("SVGFEUnstyledLeaf"), aResult); michael@0: } michael@0: #endif michael@0: michael@0: /** michael@0: * Get the "type" of the frame michael@0: * michael@0: * @see nsGkAtoms::svgFEUnstyledLeafFrame michael@0: */ michael@0: virtual nsIAtom* GetType() const MOZ_OVERRIDE; michael@0: michael@0: virtual nsresult AttributeChanged(int32_t aNameSpaceID, michael@0: nsIAtom* aAttribute, michael@0: int32_t aModType) MOZ_OVERRIDE; michael@0: michael@0: virtual bool UpdateOverflow() MOZ_OVERRIDE { michael@0: // We don't maintain a visual overflow rect michael@0: return false; michael@0: } michael@0: }; michael@0: michael@0: nsIFrame* michael@0: NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) michael@0: { michael@0: return new (aPresShell) SVGFEUnstyledLeafFrame(aContext); michael@0: } michael@0: michael@0: NS_IMPL_FRAMEARENA_HELPERS(SVGFEUnstyledLeafFrame) michael@0: michael@0: nsIAtom * michael@0: SVGFEUnstyledLeafFrame::GetType() const michael@0: { michael@0: return nsGkAtoms::svgFEUnstyledLeafFrame; michael@0: } michael@0: michael@0: nsresult michael@0: SVGFEUnstyledLeafFrame::AttributeChanged(int32_t aNameSpaceID, michael@0: nsIAtom* aAttribute, michael@0: int32_t aModType) michael@0: { michael@0: SVGFEUnstyledElement *element = static_cast(mContent); michael@0: if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) { michael@0: nsSVGEffects::InvalidateRenderingObservers(this); michael@0: } michael@0: michael@0: return SVGFEUnstyledLeafFrameBase::AttributeChanged(aNameSpaceID, michael@0: aAttribute, aModType); michael@0: }