mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
After running an `rAF` callback, if no new callbacks were registered, we send a `NoAnimationFramesCallback` to the compositor to stop ticking animations using video refresh callbacks. This interacts badly with the mechanism to track spurious animations frames i.e. rAF callbacks that don't mutate the DOM. Such 'faked' rAF callbacks are triggered by registering a oneshot timer instead of the compositor callback. The compositor's refresh callback is never enabled back again once a non-spurious rAF callback runs and registers a new rAF callback. If the former callback resets the `spurious_animations_frames` counter, then when the latter rAF callback runs, it will not schedule a OneShotTimer timer for any rAF callback that itself registers, since the counter was reset previously. Hence that third rAF callback that never runs as it relies on the compsitor's refresh callback, which was disabled previously. The current logic also doesn't actually recognize spurious animation frames because the `spurious_animations_frames` counter is updated at the end of the `run_the_animation_frame_callbacks`, effectively meaning `was_faking_animation_frames` and `self.is_faking_animation_frames` will always be the same value but the logic effectively only runs when `(!was_faking && is_faking)` is true. This patch fixes the logic to detect spurious animations frames by moving logic to update the counter to be before the check for spurious frames. It also ensures that the compositor's refesh callbacks is re-enabled once we see a non-spurious callback. Fixes #35386 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> |
||
---|---|---|
.. | ||
docs | ||
dom | ||
layout_dom | ||
xpath | ||
animation_timeline.rs | ||
animations.rs | ||
body.rs | ||
build.rs | ||
canvas_state.rs | ||
Cargo.toml | ||
clipboard_provider.rs | ||
conversions.rs | ||
devtools.rs | ||
document_collection.rs | ||
document_loader.rs | ||
drag_data_store.rs | ||
fetch.rs | ||
iframe_collection.rs | ||
init.rs | ||
layout_image.rs | ||
lib.rs | ||
links.rs | ||
mem.rs | ||
messaging.rs | ||
microtask.rs | ||
navigation.rs | ||
network_listener.rs | ||
realms.rs | ||
script_module.rs | ||
script_runtime.rs | ||
script_thread.rs | ||
security_manager.rs | ||
serviceworker_manager.rs | ||
stylesheet_loader.rs | ||
stylesheet_set.rs | ||
task.rs | ||
task_manager.rs | ||
task_queue.rs | ||
task_source.rs | ||
test.rs | ||
textinput.rs | ||
timers.rs | ||
unminify.rs | ||
webdriver_handlers.rs | ||
window_named_properties.rs |