Bumping manifests a=b2g-bump
[gecko.git] / layout / svg / SVGFEContainerFrame.cpp
blobad9da5ff37f9b220dd832f6a98a0a0096a058124
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 // Keep in (case-insensitive) order:
7 #include "nsContainerFrame.h"
8 #include "nsGkAtoms.h"
9 #include "nsIFrame.h"
10 #include "nsLiteralString.h"
11 #include "nsSVGEffects.h"
12 #include "nsSVGFilters.h"
14 typedef nsContainerFrame SVGFEContainerFrameBase;
17 * This frame is used by filter primitive elements that
18 * have special child elements that provide parameters.
20 class SVGFEContainerFrame : public SVGFEContainerFrameBase
22 friend nsIFrame*
23 NS_NewSVGFEContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
24 protected:
25 explicit SVGFEContainerFrame(nsStyleContext* aContext)
26 : SVGFEContainerFrameBase(aContext)
28 AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
31 public:
32 NS_DECL_FRAMEARENA_HELPERS
34 virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
36 return SVGFEContainerFrameBase::IsFrameOfType(
37 aFlags & ~(nsIFrame::eSVG | nsIFrame::eSVGContainer));
40 #ifdef DEBUG_FRAME_DUMP
41 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE
43 return MakeFrameName(NS_LITERAL_STRING("SVGFEContainer"), aResult);
45 #endif
47 #ifdef DEBUG
48 virtual void Init(nsIContent* aContent,
49 nsContainerFrame* aParent,
50 nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
51 #endif
52 /**
53 * Get the "type" of the frame
55 * @see nsGkAtoms::svgFEContainerFrame
57 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
59 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
60 nsIAtom* aAttribute,
61 int32_t aModType) MOZ_OVERRIDE;
63 virtual bool UpdateOverflow() MOZ_OVERRIDE {
64 // We don't maintain a visual overflow rect
65 return false;
69 nsIFrame*
70 NS_NewSVGFEContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
72 return new (aPresShell) SVGFEContainerFrame(aContext);
75 NS_IMPL_FRAMEARENA_HELPERS(SVGFEContainerFrame)
77 #ifdef DEBUG
78 void
79 SVGFEContainerFrame::Init(nsIContent* aContent,
80 nsContainerFrame* aParent,
81 nsIFrame* aPrevInFlow)
83 NS_ASSERTION(aContent->IsNodeOfType(nsINode::eFILTER),
84 "Trying to construct an SVGFEContainerFrame for a "
85 "content element that doesn't support the right interfaces");
87 SVGFEContainerFrameBase::Init(aContent, aParent, aPrevInFlow);
89 #endif /* DEBUG */
91 nsIAtom *
92 SVGFEContainerFrame::GetType() const
94 return nsGkAtoms::svgFEContainerFrame;
97 nsresult
98 SVGFEContainerFrame::AttributeChanged(int32_t aNameSpaceID,
99 nsIAtom* aAttribute,
100 int32_t aModType)
102 nsSVGFE *element = static_cast<nsSVGFE*>(mContent);
103 if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
104 nsSVGEffects::InvalidateRenderingObservers(this);
107 return SVGFEContainerFrameBase::AttributeChanged(aNameSpaceID,
108 aAttribute, aModType);