aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2016-01-27 09:25:20 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2016-01-27 09:25:20 +1000
commitde81d8832429ac449e036e48fb0d7ab796edf641 (patch)
treeb63f2eef6bea8cde376e813d84c7d85100e46bf0 /components/script/dom
parentdfaf28d5cdc2577271c09874b23bed784483a4d8 (diff)
downloadservo-de81d8832429ac449e036e48fb0d7ab796edf641.tar.gz
servo-de81d8832429ac449e036e48fb0d7ab796edf641.zip
Add comment to explain callback ordering
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/document.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs
index 9edc7bb9c35..b5672319837 100644
--- a/components/script/dom/document.rs
+++ b/components/script/dom/document.rs
@@ -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(),