Bug 1073336 part 13 - Add AnimationPlayer::PostUpdate; r=dbaron
authorBrian Birtles <birtles@gmail.com>
Mon, 17 Nov 2014 13:45:59 +0900
changeset 240287 52a3c36054d602faf5ce1f84447e26efac7a78ca
parent 240286 80cffa4575c6e34bf94526df05d7d055ae4eb1bc
child 240288 3ab8b0f5f2c7e7aa0ab72e622aa1b74b001583d5
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1073336
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1073336 part 13 - Add AnimationPlayer::PostUpdate; r=dbaron Adds a method for notifying the collection of changes to one of its players.
dom/animation/AnimationPlayer.cpp
dom/animation/AnimationPlayer.h
--- a/dom/animation/AnimationPlayer.cpp
+++ b/dom/animation/AnimationPlayer.cpp
@@ -231,16 +231,25 @@ AnimationPlayer::MaybePostRestyle() cons
 
   // FIXME: This is a bit heavy-handed but in bug 1073336 we hope to
   // introduce a better means for players to update style.
   nsLayoutUtils::PostRestyleEvent(targetElement,
                                   eRestyle_Self,
                                   nsChangeHint_AllReflowHints);
 }
 
+void
+AnimationPlayer::PostUpdate()
+{
+  AnimationPlayerCollection* collection = GetCollection();
+  if (collection) {
+    collection->NotifyPlayerUpdated();
+  }
+}
+
 StickyTimeDuration
 AnimationPlayer::SourceContentEnd() const
 {
   if (!mSource) {
     return StickyTimeDuration(0);
   }
 
   return mSource->Timing().mDelay
--- a/dom/animation/AnimationPlayer.h
+++ b/dom/animation/AnimationPlayer.h
@@ -123,16 +123,17 @@ public:
                     bool& aNeedsRefreshes);
 
   // The beginning of the delay period.
   Nullable<TimeDuration> mStartTime; // Timeline timescale
 
 protected:
   void FlushStyle() const;
   void MaybePostRestyle() const;
+  void PostUpdate();
   StickyTimeDuration SourceContentEnd() const;
 
   nsIDocument* GetRenderedDocument() const;
   nsPresContext* GetPresContext() const;
   virtual css::CommonAnimationManager* GetAnimationManager() const = 0;
   AnimationPlayerCollection* GetCollection() const;
 
   nsRefPtr<AnimationTimeline> mTimeline;