Add comment to explain callback ordering

This commit is contained in:
Glenn Watson 2016-01-27 09:25:20 +10:00
parent dfaf28d5cd
commit de81d88324

View file

@ -1208,6 +1208,10 @@ impl Document {
callback(*timing);
}
// Only send the animation change state message after running any callbacks.
// This means that if the animation callback adds a new callback for
// the next frame (which is the common case), we won't send a NoAnimationCallbacksPresent
// message quickly followed by an AnimationCallbacksPresent message.
if self.animation_frame_list.borrow().is_empty() {
let ConstellationChan(ref chan) = self.window.constellation_chan();
let event = ConstellationMsg::ChangeRunningAnimationsState(self.window.pipeline(),