mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Stop embedder calls and fake rAF when window not visible
This commit is contained in:
parent
3749eb5397
commit
21c408e0d5
3 changed files with 11 additions and 6 deletions
|
@ -1636,11 +1636,10 @@ impl Document {
|
|||
.borrow_mut()
|
||||
.push((ident, Some(callback)));
|
||||
|
||||
// TODO: Should tick animation only when document is visible
|
||||
|
||||
// If we are running 'fake' animation frames, we unconditionally
|
||||
// set up a one-shot timer for script to execute the rAF callbacks.
|
||||
if self.is_faking_animation_frames() {
|
||||
if self.is_faking_animation_frames() && self.window().visible() {
|
||||
warn!("Scheduling fake animation frame. Animation frames tick too fast.");
|
||||
let callback = FakeRequestAnimationFrameCallback {
|
||||
document: Trusted::new(self),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue