From 17e3f34e65052d6f34450e9c9b0248b793c68753 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Tue, 25 Apr 2023 10:48:13 +0200 Subject: Fix flakiness in animation tests 1. When updating the animation timeline, ensure that nodes that are animating are marked dirty, if necessary, so any style queries will force an layout flush. 2. Disable the problematic transition test suites, as they are in Gecko. These suites often fail when Servo is so overloaded that it cannot deliver frames fast enough to get more than two samples during the animation lifecycle. Fixes #28334. Fixes #26435. Fixes #21486. --- components/script/script_thread.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'components/script/script_thread.rs') diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index b417f453cdf..f52fc0d777a 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1702,10 +1702,12 @@ impl ScriptThread { true } - // Perform step 11.10 from https://html.spec.whatwg.org/multipage/#event-loops. + // Perform step 7.10 from https://html.spec.whatwg.org/multipage/#event-loop-processing-model. + // Described at: https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events fn update_animations_and_send_events(&self) { for (_, document) in self.documents.borrow().iter() { document.update_animation_timeline(); + document.maybe_mark_animating_nodes_as_dirty(); } for (_, document) in self.documents.borrow().iter() { @@ -3012,8 +3014,7 @@ impl ScriptThread { document.run_the_animation_frame_callbacks(); } if tick_type.contains(AnimationTickType::CSS_ANIMATIONS_AND_TRANSITIONS) { - document.animations().mark_animating_nodes_as_dirty(); - document.window().add_pending_reflow(); + document.maybe_mark_animating_nodes_as_dirty(); } } -- cgit v1.2.3