Bug 1194037 part 5 - Make AnimationProperty::operator== ignore mWinsInCascade; r=heycam
☠☠ backed out by 70a1ba1460e4 ☠ ☠
authorBrian Birtles <birtles@gmail.com>
Tue, 08 Sep 2015 09:53:13 +0900
changeset 290944 ad5763672ad206da79bd7e0ea9bc830f1e9c03a5
parent 290943 391d49ed7ca77855209c6c1ab7ce9bcb56ff1faa
child 290945 9fd02ff21f65e016ac421a98730cc619ecb15cce
push id5188
push userdburns@mozilla.com
push dateTue, 08 Sep 2015 12:16:07 +0000
reviewersheycam
bugs1194037
milestone43.0a1
Bug 1194037 part 5 - Make AnimationProperty::operator== ignore mWinsInCascade; r=heycam
dom/animation/KeyframeEffect.h
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -163,23 +163,30 @@ struct AnimationProperty
   // cascade and for OMTA.
   //
   // For CSS Animations, which are overridden by !important rules in the
   // cascade, we actually determine this from the CSS cascade
   // computations, and then use it for OMTA.
   // **NOTE**: For CSS animations, we only bother setting mWinsInCascade
   // accurately for properties that we can animate on the compositor.
   // For other properties, we make it always be true.
+  // **NOTE 2**: This member is not included when comparing AnimationProperty
+  // objects for equality.
   bool mWinsInCascade;
 
   InfallibleTArray<AnimationPropertySegment> mSegments;
 
+  // NOTE: This operator does *not* compare the mWinsInCascade member.
+  // This is because AnimationProperty objects are compared when recreating
+  // CSS animations to determine if mutation observer change records need to
+  // be created or not. However, at the point when these objects are compared
+  // the mWinsInCascade will not have been set on the new objects so we ignore
+  // this member to avoid generating spurious change records.
   bool operator==(const AnimationProperty& aOther) const {
     return mProperty == aOther.mProperty &&
-           mWinsInCascade == aOther.mWinsInCascade &&
            mSegments == aOther.mSegments;
   }
   bool operator!=(const AnimationProperty& aOther) const {
     return !(*this == aOther);
   }
 };
 
 struct ElementPropertyTransition;