Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | // Keep in (case-insensitive) order: |
michael@0 | 7 | #include "nsFrame.h" |
michael@0 | 8 | #include "nsGkAtoms.h" |
michael@0 | 9 | #include "nsSVGEffects.h" |
michael@0 | 10 | #include "nsSVGFilters.h" |
michael@0 | 11 | |
michael@0 | 12 | typedef nsFrame SVGFEUnstyledLeafFrameBase; |
michael@0 | 13 | |
michael@0 | 14 | class SVGFEUnstyledLeafFrame : public SVGFEUnstyledLeafFrameBase |
michael@0 | 15 | { |
michael@0 | 16 | friend nsIFrame* |
michael@0 | 17 | NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); |
michael@0 | 18 | protected: |
michael@0 | 19 | SVGFEUnstyledLeafFrame(nsStyleContext* aContext) |
michael@0 | 20 | : SVGFEUnstyledLeafFrameBase(aContext) |
michael@0 | 21 | { |
michael@0 | 22 | AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY); |
michael@0 | 23 | } |
michael@0 | 24 | |
michael@0 | 25 | public: |
michael@0 | 26 | NS_DECL_FRAMEARENA_HELPERS |
michael@0 | 27 | |
michael@0 | 28 | virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, |
michael@0 | 29 | const nsRect& aDirtyRect, |
michael@0 | 30 | const nsDisplayListSet& aLists) MOZ_OVERRIDE {} |
michael@0 | 31 | |
michael@0 | 32 | virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE |
michael@0 | 33 | { |
michael@0 | 34 | return SVGFEUnstyledLeafFrameBase::IsFrameOfType(aFlags & ~(nsIFrame::eSVG)); |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | #ifdef DEBUG_FRAME_DUMP |
michael@0 | 38 | virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE |
michael@0 | 39 | { |
michael@0 | 40 | return MakeFrameName(NS_LITERAL_STRING("SVGFEUnstyledLeaf"), aResult); |
michael@0 | 41 | } |
michael@0 | 42 | #endif |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * Get the "type" of the frame |
michael@0 | 46 | * |
michael@0 | 47 | * @see nsGkAtoms::svgFEUnstyledLeafFrame |
michael@0 | 48 | */ |
michael@0 | 49 | virtual nsIAtom* GetType() const MOZ_OVERRIDE; |
michael@0 | 50 | |
michael@0 | 51 | virtual nsresult AttributeChanged(int32_t aNameSpaceID, |
michael@0 | 52 | nsIAtom* aAttribute, |
michael@0 | 53 | int32_t aModType) MOZ_OVERRIDE; |
michael@0 | 54 | |
michael@0 | 55 | virtual bool UpdateOverflow() MOZ_OVERRIDE { |
michael@0 | 56 | // We don't maintain a visual overflow rect |
michael@0 | 57 | return false; |
michael@0 | 58 | } |
michael@0 | 59 | }; |
michael@0 | 60 | |
michael@0 | 61 | nsIFrame* |
michael@0 | 62 | NS_NewSVGFEUnstyledLeafFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) |
michael@0 | 63 | { |
michael@0 | 64 | return new (aPresShell) SVGFEUnstyledLeafFrame(aContext); |
michael@0 | 65 | } |
michael@0 | 66 | |
michael@0 | 67 | NS_IMPL_FRAMEARENA_HELPERS(SVGFEUnstyledLeafFrame) |
michael@0 | 68 | |
michael@0 | 69 | nsIAtom * |
michael@0 | 70 | SVGFEUnstyledLeafFrame::GetType() const |
michael@0 | 71 | { |
michael@0 | 72 | return nsGkAtoms::svgFEUnstyledLeafFrame; |
michael@0 | 73 | } |
michael@0 | 74 | |
michael@0 | 75 | nsresult |
michael@0 | 76 | SVGFEUnstyledLeafFrame::AttributeChanged(int32_t aNameSpaceID, |
michael@0 | 77 | nsIAtom* aAttribute, |
michael@0 | 78 | int32_t aModType) |
michael@0 | 79 | { |
michael@0 | 80 | SVGFEUnstyledElement *element = static_cast<SVGFEUnstyledElement*>(mContent); |
michael@0 | 81 | if (element->AttributeAffectsRendering(aNameSpaceID, aAttribute)) { |
michael@0 | 82 | nsSVGEffects::InvalidateRenderingObservers(this); |
michael@0 | 83 | } |
michael@0 | 84 | |
michael@0 | 85 | return SVGFEUnstyledLeafFrameBase::AttributeChanged(aNameSpaceID, |
michael@0 | 86 | aAttribute, aModType); |
michael@0 | 87 | } |