Bug 562815 part 7 - Don't cache display animation values (due to bug 536660); r=dholbert
authorBrian Birtles <birtles@gmail.com>
Tue, 23 Aug 2011 08:34:16 +0900
changeset 75695 f385c77d177ef1e3dcdb30a180e0ce92e1b48204
parent 75694 621f3dd51ed24c5a5ed986ca4c2b228ac9f27f08
child 75696 0fba4d8f69c522d6578b710bc1e77fc3a3907cb8
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersdholbert
bugs562815, 536660
milestone9.0a1
Bug 562815 part 7 - Don't cache display animation values (due to bug 536660); r=dholbert
content/smil/nsSMILCSSProperty.cpp
--- a/content/smil/nsSMILCSSProperty.cpp
+++ b/content/smil/nsSMILCSSProperty.cpp
@@ -163,16 +163,24 @@ nsSMILCSSProperty::ValueFromString(const
                                    const nsISMILAnimationElement* aSrcElement,
                                    nsSMILValue& aValue,
                                    PRBool& aPreventCachingOfSandwich) const
 {
   NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);
 
   nsSMILCSSValueType::ValueFromString(mPropID, mElement, aStr, aValue,
       &aPreventCachingOfSandwich);
+
+  // XXX Due to bug 536660 (or at least that seems to be the most likely
+  // culprit), when we have animation setting display:none on a <use> element,
+  // if we DON'T set the property every sample, chaos ensues.
+  if (!aPreventCachingOfSandwich && mPropID == eCSSProperty_display) {
+    aPreventCachingOfSandwich = PR_TRUE;
+  }
+
   return aValue.IsNull() ? NS_ERROR_FAILURE : NS_OK;
 }
 
 nsresult
 nsSMILCSSProperty::SetAnimValue(const nsSMILValue& aValue)
 {
   NS_ENSURE_TRUE(IsPropertyAnimatable(mPropID), NS_ERROR_FAILURE);