dom/smil/nsSMILCSSProperty.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 /* representation of a SMIL-animatable CSS property on an element */
michael@0 7
michael@0 8 #ifndef NS_SMILCSSPROPERTY_H_
michael@0 9 #define NS_SMILCSSPROPERTY_H_
michael@0 10
michael@0 11 #include "mozilla/Attributes.h"
michael@0 12 #include "nsISMILAttr.h"
michael@0 13 #include "nsIAtom.h"
michael@0 14 #include "nsCSSProperty.h"
michael@0 15 #include "nsCSSValue.h"
michael@0 16
michael@0 17 namespace mozilla {
michael@0 18 namespace dom {
michael@0 19 class Element;
michael@0 20 } // namespace dom
michael@0 21 } // namespace mozilla
michael@0 22
michael@0 23 /**
michael@0 24 * nsSMILCSSProperty: Implements the nsISMILAttr interface for SMIL animations
michael@0 25 * that target CSS properties. Represents a particular animation-targeted CSS
michael@0 26 * property on a particular element.
michael@0 27 */
michael@0 28 class nsSMILCSSProperty : public nsISMILAttr
michael@0 29 {
michael@0 30 public:
michael@0 31 /**
michael@0 32 * Constructs a new nsSMILCSSProperty.
michael@0 33 * @param aPropID The CSS property we're interested in animating.
michael@0 34 * @param aElement The element whose CSS property is being animated.
michael@0 35 */
michael@0 36 nsSMILCSSProperty(nsCSSProperty aPropID, mozilla::dom::Element* aElement);
michael@0 37
michael@0 38 // nsISMILAttr methods
michael@0 39 virtual nsresult ValueFromString(const nsAString& aStr,
michael@0 40 const mozilla::dom::SVGAnimationElement* aSrcElement,
michael@0 41 nsSMILValue& aValue,
michael@0 42 bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE;
michael@0 43 virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE;
michael@0 44 virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE;
michael@0 45 virtual void ClearAnimValue() MOZ_OVERRIDE;
michael@0 46
michael@0 47 /**
michael@0 48 * Utility method - returns true if the given property is supported for
michael@0 49 * SMIL animation.
michael@0 50 *
michael@0 51 * @param aProperty The property to check for animation support.
michael@0 52 * @return true if the given property is supported for SMIL animation, or
michael@0 53 * false otherwise
michael@0 54 */
michael@0 55 static bool IsPropertyAnimatable(nsCSSProperty aPropID);
michael@0 56
michael@0 57 protected:
michael@0 58 nsCSSProperty mPropID;
michael@0 59 // Using non-refcounted pointer for mElement -- we know mElement will stay
michael@0 60 // alive for my lifetime because a nsISMILAttr (like me) only lives as long
michael@0 61 // as the Compositing step, and DOM elements don't get a chance to die during
michael@0 62 // that time.
michael@0 63 mozilla::dom::Element* mElement;
michael@0 64 };
michael@0 65
michael@0 66 #endif // NS_SMILCSSPROPERTY_H_

mercurial