2009-10-02 14:37:25 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2009-10-02 14:37:25 -07:00
|
|
|
|
|
|
|
/* representation of a SMIL-animatable CSS property on an element */
|
|
|
|
|
|
|
|
#ifndef NS_SMILCSSPROPERTY_H_
|
|
|
|
#define NS_SMILCSSPROPERTY_H_
|
|
|
|
|
2013-05-29 13:43:41 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2009-10-02 14:37:25 -07:00
|
|
|
#include "nsISMILAttr.h"
|
|
|
|
#include "nsIAtom.h"
|
|
|
|
#include "nsCSSProperty.h"
|
|
|
|
#include "nsCSSValue.h"
|
|
|
|
|
2010-05-14 10:04:51 -07:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
class Element;
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2009-10-02 14:37:25 -07:00
|
|
|
/**
|
|
|
|
* nsSMILCSSProperty: Implements the nsISMILAttr interface for SMIL animations
|
|
|
|
* that target CSS properties. Represents a particular animation-targeted CSS
|
|
|
|
* property on a particular element.
|
|
|
|
*/
|
|
|
|
class nsSMILCSSProperty : public nsISMILAttr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Constructs a new nsSMILCSSProperty.
|
|
|
|
* @param aPropID The CSS property we're interested in animating.
|
|
|
|
* @param aElement The element whose CSS property is being animated.
|
|
|
|
*/
|
2010-05-14 10:04:51 -07:00
|
|
|
nsSMILCSSProperty(nsCSSProperty aPropID, mozilla::dom::Element* aElement);
|
2009-10-02 14:37:25 -07:00
|
|
|
|
|
|
|
// nsISMILAttr methods
|
|
|
|
virtual nsresult ValueFromString(const nsAString& aStr,
|
2013-03-18 20:18:45 -07:00
|
|
|
const mozilla::dom::SVGAnimationElement* aSrcElement,
|
2010-02-20 13:13:11 -08:00
|
|
|
nsSMILValue& aValue,
|
2013-05-29 13:43:41 -07:00
|
|
|
bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE;
|
|
|
|
virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE;
|
|
|
|
virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE;
|
|
|
|
virtual void ClearAnimValue() MOZ_OVERRIDE;
|
2009-10-02 14:37:25 -07:00
|
|
|
|
|
|
|
/**
|
2011-10-17 07:59:28 -07:00
|
|
|
* Utility method - returns true if the given property is supported for
|
2009-10-02 14:37:25 -07:00
|
|
|
* SMIL animation.
|
|
|
|
*
|
|
|
|
* @param aProperty The property to check for animation support.
|
2011-10-17 07:59:28 -07:00
|
|
|
* @return true if the given property is supported for SMIL animation, or
|
|
|
|
* false otherwise
|
2009-10-02 14:37:25 -07:00
|
|
|
*/
|
2011-09-28 23:19:26 -07:00
|
|
|
static bool IsPropertyAnimatable(nsCSSProperty aPropID);
|
2009-10-02 14:37:25 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
nsCSSProperty mPropID;
|
|
|
|
// Using non-refcounted pointer for mElement -- we know mElement will stay
|
|
|
|
// alive for my lifetime because a nsISMILAttr (like me) only lives as long
|
|
|
|
// as the Compositing step, and DOM elements don't get a chance to die during
|
|
|
|
// that time.
|
2010-05-14 10:04:51 -07:00
|
|
|
mozilla::dom::Element* mElement;
|
2009-10-02 14:37:25 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NS_SMILCSSPROPERTY_H_
|