aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-05-21 10:11:45 -0400
committerGitHub <noreply@github.com>2020-05-21 10:11:45 -0400
commit70700c20ed8bc3d82e709a3d48e03d8e16530361 (patch)
tree7eaa9b03598d82ea1f9dd8e71c38cf34688ca09e /components/script/script_thread.rs
parentc8b6329575d62c912fab5980ac733dd5d9bff260 (diff)
parent873cdd13368d904e4723fec1d60ecc04d9dbe03d (diff)
downloadservo-70700c20ed8bc3d82e709a3d48e03d8e16530361.tar.gz
servo-70700c20ed8bc3d82e709a3d48e03d8e16530361.zip
Auto merge of #26594 - mrobinson:animationiteration, r=jdm
Implement animationiteration event This event is triggered when an animation iterates. This change also moves iteration out of style calculation to an "update animations" which is the next part of having animation event handling match the HTML spec. This change causes a few more tests to pass. Some of the other tests which exercise this functionality require `animationstart` events. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 2107cd070cd..d061dc7d32e 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -149,7 +149,6 @@ use script_traits::{
};
use servo_atoms::Atom;
use servo_config::opts;
-use servo_config::pref;
use servo_url::{ImmutableOrigin, MutableOrigin, ServoUrl};
use std::borrow::Cow;
use std::cell::Cell;
@@ -1631,19 +1630,17 @@ impl ScriptThread {
// TODO(mrobinson): This should also update the current animations to conform to
// the HTML specification.
fn update_animations_and_send_events(&self) {
- for (_, document) in self.documents.borrow().iter() {
- // Only update the time if it isn't being managed by a test.
- if !pref!(layout.animations.test.enabled) {
- document.update_animation_timeline();
- }
- }
-
// We remove the events because handling these events might trigger
// a reflow which might want to add more events to the queue.
let events = self.animation_events.replace(Vec::new());
for event in events.into_iter() {
self.handle_transition_or_animation_event(&event);
}
+
+ for (_, document) in self.documents.borrow().iter() {
+ let update = document.update_animation_timeline();
+ unsafe { ScriptThread::process_animations_update(update) };
+ }
}
fn categorize_msg(&self, msg: &MixedMessage) -> ScriptThreadEventCategory {
@@ -2947,6 +2944,7 @@ impl ScriptThread {
let event_atom = match event.event_type {
TransitionOrAnimationEventType::AnimationEnd => atom!("animationend"),
+ TransitionOrAnimationEventType::AnimationIteration => atom!("animationiteration"),
TransitionOrAnimationEventType::TransitionCancel => atom!("transitioncancel"),
TransitionOrAnimationEventType::TransitionEnd => atom!("transitionend"),
TransitionOrAnimationEventType::TransitionRun => atom!("transitionrun"),