smil_mappedAttrs: Add missing "FlushChangesToTargetAttr" call in nsSMILMappedAttribute::GetBaseValue, after we've re-inserted the animated value.
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 28 Jan 2010 03:39:47 -0800
changeset 1074 50bc0a4c6fe9
parent 1073 acc29eb11c65
child 1075 f1710465b8b8
push id882
push userdholbert@mozilla.com
push dateThu, 28 Jan 2010 11:39:54 +0000
smil_mappedAttrs: Add missing "FlushChangesToTargetAttr" call in nsSMILMappedAttribute::GetBaseValue, after we've re-inserted the animated value.
smil_mappedAttrs
--- a/smil_mappedAttrs
+++ b/smil_mappedAttrs
@@ -64,17 +64,17 @@ diff --git a/content/smil/Makefile.in b/
  
  INCLUDES += 	\
  		-I$(srcdir)/../base/src \
  		-I$(srcdir)/../../layout/style \
 diff --git a/content/smil/nsSMILMappedAttribute.cpp b/content/smil/nsSMILMappedAttribute.cpp
 new file mode 100644
 --- /dev/null
 +++ b/content/smil/nsSMILMappedAttribute.cpp
-@@ -0,0 +1,161 @@
+@@ -0,0 +1,162 @@
 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 +/* ***** BEGIN LICENSE BLOCK *****
 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 + *
 + * The contents of this file are subject to the Mozilla Public License Version
 + * 1.1 (the "License"); you may not use this file except in compliance with
 + * the License. You may obtain a copy of the License at
 + * http://www.mozilla.org/MPL/
@@ -162,16 +162,17 @@ new file mode 100644
 +    // This prevents any animations that target the CSS property from affecting
 +    // animations that target the mapped attribute.
 +    baseValue = nsSMILCSSProperty::GetBaseValue();
 +
 +    // FINALLY: If we originally had an animated value set, then set it again.
 +    if (buf) {
 +      mElement->SetProperty(SMIL_MAPPED_ATTR_ANIMVAL, attrName, buf,
 +                            ReleaseStringBufferPropertyValue);
++      FlushChangesToTargetAttr();
 +    }
 +  }
 +  return baseValue;
 +}
 +
 +nsresult
 +nsSMILMappedAttribute::SetAnimValue(const nsSMILValue& aValue)
 +{
@@ -377,17 +378,17 @@ diff --git a/content/svg/content/src/nsS
    return NS_OK;
  }
  
  // PresentationAttributes-FillStroke
  /* static */ const nsGenericElement::MappedAttributeEntry
  nsSVGElement::sFillStrokeMap[] = {
    { &nsGkAtoms::fill },
    { &nsGkAtoms::fill_opacity },
-@@ -1142,16 +1169,97 @@ nsSVGElement::UpdateContentStyleRule()
+@@ -1151,16 +1178,97 @@ nsSVGElement::UpdateContentStyleRule()
      if (!mappedAttrParser.ParseMappedAttrValue(attrName->Atom(), value)) {
        // Error initializing declaration
        return;
      }
    }
    mContentStyleRule = mappedAttrParser.CreateStyleRule();
  }
  
@@ -475,17 +476,17 @@ diff --git a/content/svg/content/src/nsS
  nsISVGValue*
  nsSVGElement::GetMappedAttribute(PRInt32 aNamespaceID, nsIAtom* aName)
  {
    const nsAttrValue* attrVal = mMappedAttributes.GetAttr(aName, aNamespaceID);
    if (!attrVal)
      return nsnull;
  
    return attrVal->GetSVGValue();
-@@ -1809,16 +1917,29 @@ nsSVGElement::GetAnimatedAttr(nsIAtom* a
+@@ -1818,16 +1926,29 @@ nsSVGElement::GetAnimatedAttr(nsIAtom* a
      BooleanAttributesInfo info = GetBooleanInfo();
      for (PRUint32 i = 0; i < info.mBooleanCount; i++) {
        if (aName == *info.mBooleanInfo[i].mName) {
          return info.mBooleans[i].ToSMILAttr(this);
        }
      }
    }