Use setTimeout() trick instead of Window.requestIdleCallback() (#3044)
This commit is contained in:
parent
68ef9f707e
commit
48abf52aac
7 changed files with 198 additions and 133 deletions
|
|
@ -627,9 +627,11 @@ impl<T: 'static> Shared<T> {
|
|||
ControlFlow::Poll => {
|
||||
let cloned = self.clone();
|
||||
State::Poll {
|
||||
request: backend::IdleCallback::new(self.window().clone(), move || {
|
||||
cloned.poll()
|
||||
}),
|
||||
request: backend::Schedule::new(
|
||||
self.window().clone(),
|
||||
move || cloned.poll(),
|
||||
None,
|
||||
),
|
||||
}
|
||||
}
|
||||
ControlFlow::Wait => State::Wait {
|
||||
|
|
@ -649,10 +651,10 @@ impl<T: 'static> Shared<T> {
|
|||
State::WaitUntil {
|
||||
start,
|
||||
end,
|
||||
timeout: backend::Timeout::new(
|
||||
timeout: backend::Schedule::new(
|
||||
self.window().clone(),
|
||||
move || cloned.resume_time_reached(start, end),
|
||||
delay,
|
||||
Some(delay),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue