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 | /* representation of a SMIL-animatable mapped attribute on an element */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef NS_SMILMAPPEDATTRIBUTE_H_ |
michael@0 | 9 | #define NS_SMILMAPPEDATTRIBUTE_H_ |
michael@0 | 10 | |
michael@0 | 11 | #include "mozilla/Attributes.h" |
michael@0 | 12 | #include "nsSMILCSSProperty.h" |
michael@0 | 13 | |
michael@0 | 14 | /* We'll use the empty-string atom |nsGkAtoms::_empty| as the key for storing |
michael@0 | 15 | * an element's animated content style rule in its Property Table, under the |
michael@0 | 16 | * property-category SMIL_MAPPED_ATTR_ANIMVAL. Everything else stored in that |
michael@0 | 17 | * category is keyed off of the XML attribute name, so the empty string is a |
michael@0 | 18 | * good "reserved" key to use for storing the style rule (since XML attributes |
michael@0 | 19 | * all have nonempty names). |
michael@0 | 20 | */ |
michael@0 | 21 | #define SMIL_MAPPED_ATTR_STYLERULE_ATOM nsGkAtoms::_empty |
michael@0 | 22 | |
michael@0 | 23 | /** |
michael@0 | 24 | * nsSMILMappedAttribute: Implements the nsISMILAttr interface for SMIL |
michael@0 | 25 | * animations whose targets are attributes that map to CSS properties. An |
michael@0 | 26 | * instance of this class represents a particular animation-targeted mapped |
michael@0 | 27 | * attribute on a particular element. |
michael@0 | 28 | */ |
michael@0 | 29 | class nsSMILMappedAttribute : public nsSMILCSSProperty { |
michael@0 | 30 | public: |
michael@0 | 31 | /** |
michael@0 | 32 | * Constructs a new nsSMILMappedAttribute. |
michael@0 | 33 | * |
michael@0 | 34 | * @param aPropID The CSS property for the mapped attribute we're |
michael@0 | 35 | * interested in animating. |
michael@0 | 36 | * @param aElement The element whose attribute is being animated. |
michael@0 | 37 | */ |
michael@0 | 38 | nsSMILMappedAttribute(nsCSSProperty aPropID, mozilla::dom::Element* aElement) : |
michael@0 | 39 | nsSMILCSSProperty(aPropID, aElement) {} |
michael@0 | 40 | |
michael@0 | 41 | // nsISMILAttr methods |
michael@0 | 42 | virtual nsresult ValueFromString(const nsAString& aStr, |
michael@0 | 43 | const mozilla::dom::SVGAnimationElement* aSrcElement, |
michael@0 | 44 | nsSMILValue& aValue, |
michael@0 | 45 | bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE; |
michael@0 | 46 | virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE; |
michael@0 | 47 | virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE; |
michael@0 | 48 | virtual void ClearAnimValue() MOZ_OVERRIDE; |
michael@0 | 49 | |
michael@0 | 50 | protected: |
michael@0 | 51 | // Helper Methods |
michael@0 | 52 | void FlushChangesToTargetAttr() const; |
michael@0 | 53 | already_AddRefed<nsIAtom> GetAttrNameAtom() const; |
michael@0 | 54 | }; |
michael@0 | 55 | #endif // NS_SMILMAPPEDATTRIBUTE_H_ |