Bug 1012740 - Change as not to abort in GrallocTextureHostOGL::GrallocTextureHostOGL...
[gecko.git] / layout / svg / SVGFEUnstyledLeafFrame.cpp
blobe02ea9c00a5de90071448169c9f67afe62a0d226
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 "nsFrame.h"
8 #include "nsGkAtoms.h"
9 #include "nsSVGEffects.h"
10 #include "nsSVGFilters.h"
12 typedef nsFrame SVGFEUnstyledLeafFrameBase;
14 class SVGFEUnstyledLeafFrame : public SVGFEUnstyledLeafFrameBase
16 friend nsIFrame*
17 NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
18 protected:
19 SVGFEUnstyledLeafFrame(nsStyleContext* aContext)
20 : SVGFEUnstyledLeafFrameBase(aContext)
22 AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
25 public:
26 NS_DECL_FRAMEARENA_HELPERS
28 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
29 const nsRect& aDirtyRect,
30 const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
32 virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
34 return SVGFEUnstyledLeafFrameBase::IsFrameOfType(aFlags & ~(nsIFrame::eSVG));
37 #ifdef DEBUG_FRAME_DUMP
38 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE
40 return MakeFrameName(NS_LITERAL_STRING("SVGFEUnstyledLeaf"), aResult);
42 #endif
44 /**
45 * Get the "type" of the frame
47 * @see nsGkAtoms::svgFEUnstyledLeafFrame
49 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
51 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
52 nsIAtom* aAttribute,
53 int32_t aModType) MOZ_OVERRIDE;
55 virtual bool UpdateOverflow() MOZ_OVERRIDE {
56 // We don't maintain a visual overflow rect
57 return false;
61 nsIFrame*
62 NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
64 return new (aPresShell) SVGFEUnstyledLeafFrame(aContext);
67 NS_IMPL_FRAMEARENA_HELPERS(SVGFEUnstyledLeafFrame)
69 nsIAtom *
70 SVGFEUnstyledLeafFrame::GetType() const
72 return nsGkAtoms::svgFEUnstyledLeafFrame;
75 nsresult
76 SVGFEUnstyledLeafFrame::AttributeChanged(int32_t aNameSpaceID,
77 nsIAtom* aAttribute,
78 int32_t aModType)
80 SVGFEUnstyledElement *element = static_cast<SVGFEUnstyledElement*>(mContent);
81 if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) {
82 nsSVGEffects::InvalidateRenderingObservers(this);
85 return SVGFEUnstyledLeafFrameBase::AttributeChanged(aNameSpaceID,
86 aAttribute, aModType);