diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/smil/nsSMILCSSProperty.h | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/smil/nsSMILCSSProperty.h')
-rw-r--r-- | dom/smil/nsSMILCSSProperty.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/dom/smil/nsSMILCSSProperty.h b/dom/smil/nsSMILCSSProperty.h new file mode 100644 index 000000000..028a9aaa2 --- /dev/null +++ b/dom/smil/nsSMILCSSProperty.h @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +/* representation of a SMIL-animatable CSS property on an element */ + +#ifndef NS_SMILCSSPROPERTY_H_ +#define NS_SMILCSSPROPERTY_H_ + +#include "mozilla/Attributes.h" +#include "nsISMILAttr.h" +#include "nsIAtom.h" +#include "nsCSSPropertyID.h" +#include "nsCSSValue.h" + +namespace mozilla { +namespace dom { +class Element; +} // namespace dom +} // namespace mozilla + +/** + * 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. + */ + nsSMILCSSProperty(nsCSSPropertyID aPropID, mozilla::dom::Element* aElement); + + // nsISMILAttr methods + virtual nsresult ValueFromString(const nsAString& aStr, + const mozilla::dom::SVGAnimationElement* aSrcElement, + nsSMILValue& aValue, + bool& aPreventCachingOfSandwich) const override; + virtual nsSMILValue GetBaseValue() const override; + virtual nsresult SetAnimValue(const nsSMILValue& aValue) override; + virtual void ClearAnimValue() override; + + /** + * Utility method - returns true if the given property is supported for + * SMIL animation. + * + * @param aProperty The property to check for animation support. + * @return true if the given property is supported for SMIL animation, or + * false otherwise + */ + static bool IsPropertyAnimatable(nsCSSPropertyID aPropID); + +protected: + nsCSSPropertyID 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. + mozilla::dom::Element* mElement; +}; + +#endif // NS_SMILCSSPROPERTY_H_ |