layout/svg/nsSVGFilterFrame.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

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 #ifndef __NS_SVGFILTERFRAME_H__
michael@0 7 #define __NS_SVGFILTERFRAME_H__
michael@0 8
michael@0 9 #include "mozilla/Attributes.h"
michael@0 10 #include "nsFrame.h"
michael@0 11 #include "nsQueryFrame.h"
michael@0 12 #include "nsSVGContainerFrame.h"
michael@0 13 #include "nsSVGUtils.h"
michael@0 14
michael@0 15 class nsIAtom;
michael@0 16 class nsIContent;
michael@0 17 class nsIFrame;
michael@0 18 class nsIPresShell;
michael@0 19 class nsRenderingContext;
michael@0 20 class nsStyleContext;
michael@0 21 class nsSVGFilterPaintCallback;
michael@0 22 class nsSVGIntegerPair;
michael@0 23 class nsSVGLength2;
michael@0 24
michael@0 25 struct nsRect;
michael@0 26
michael@0 27 namespace mozilla {
michael@0 28 namespace dom {
michael@0 29 class SVGFilterElement;
michael@0 30 }
michael@0 31 }
michael@0 32
michael@0 33 typedef nsSVGContainerFrame nsSVGFilterFrameBase;
michael@0 34
michael@0 35 class nsSVGFilterFrame : public nsSVGFilterFrameBase
michael@0 36 {
michael@0 37 friend nsIFrame*
michael@0 38 NS_NewSVGFilterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
michael@0 39 protected:
michael@0 40 nsSVGFilterFrame(nsStyleContext* aContext)
michael@0 41 : nsSVGFilterFrameBase(aContext),
michael@0 42 mLoopFlag(false),
michael@0 43 mNoHRefURI(false)
michael@0 44 {
michael@0 45 AddStateBits(NS_FRAME_IS_NONDISPLAY);
michael@0 46 }
michael@0 47
michael@0 48 public:
michael@0 49 NS_DECL_FRAMEARENA_HELPERS
michael@0 50
michael@0 51 // nsIFrame methods:
michael@0 52 virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
michael@0 53 const nsRect& aDirtyRect,
michael@0 54 const nsDisplayListSet& aLists) MOZ_OVERRIDE {}
michael@0 55
michael@0 56 virtual nsresult AttributeChanged(int32_t aNameSpaceID,
michael@0 57 nsIAtom* aAttribute,
michael@0 58 int32_t aModType) MOZ_OVERRIDE;
michael@0 59
michael@0 60 #ifdef DEBUG
michael@0 61 virtual void Init(nsIContent* aContent,
michael@0 62 nsIFrame* aParent,
michael@0 63 nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
michael@0 64 #endif
michael@0 65
michael@0 66 /**
michael@0 67 * Get the "type" of the frame
michael@0 68 *
michael@0 69 * @see nsGkAtoms::svgFilterFrame
michael@0 70 */
michael@0 71 virtual nsIAtom* GetType() const MOZ_OVERRIDE;
michael@0 72
michael@0 73 private:
michael@0 74 // Parse our xlink:href and set up our nsSVGPaintingProperty if we
michael@0 75 // reference another filter and we don't have a property. Return
michael@0 76 // the referenced filter's frame if available, null otherwise.
michael@0 77 class AutoFilterReferencer;
michael@0 78 friend class nsSVGFilterInstance;
michael@0 79 nsSVGFilterFrame* GetReferencedFilter();
michael@0 80 nsSVGFilterFrame* GetReferencedFilterIfNotInUse();
michael@0 81
michael@0 82 // Accessors to lookup filter attributes
michael@0 83 uint16_t GetEnumValue(uint32_t aIndex, nsIContent *aDefault);
michael@0 84 uint16_t GetEnumValue(uint32_t aIndex)
michael@0 85 {
michael@0 86 return GetEnumValue(aIndex, mContent);
michael@0 87 }
michael@0 88 const nsSVGLength2 *GetLengthValue(uint32_t aIndex, nsIContent *aDefault);
michael@0 89 const nsSVGLength2 *GetLengthValue(uint32_t aIndex)
michael@0 90 {
michael@0 91 return GetLengthValue(aIndex, mContent);
michael@0 92 }
michael@0 93 const mozilla::dom::SVGFilterElement *GetFilterContent(nsIContent *aDefault);
michael@0 94 const mozilla::dom::SVGFilterElement *GetFilterContent()
michael@0 95 {
michael@0 96 return GetFilterContent(mContent);
michael@0 97 }
michael@0 98
michael@0 99 // This flag is used to detect loops in xlink:href processing
michael@0 100 bool mLoopFlag;
michael@0 101 bool mNoHRefURI;
michael@0 102 };
michael@0 103
michael@0 104 #endif

mercurial