mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: Stop using time
in DOM timers (#33262)
This switches to using `std::time` types for DOM timer operations, which allows removing our custom time units in favor of `Duration`. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
8a0c7487e7
commit
a4ceb82ef5
13 changed files with 78 additions and 106 deletions
|
@ -12,6 +12,7 @@ use std::ptr::NonNull;
|
|||
use std::rc::Rc;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::time::Duration;
|
||||
use std::{cmp, env, mem};
|
||||
|
||||
use app_units::Au;
|
||||
|
@ -882,7 +883,7 @@ impl WindowMethods for Window {
|
|||
self.upcast::<GlobalScope>().set_timeout_or_interval(
|
||||
callback,
|
||||
args,
|
||||
timeout,
|
||||
Duration::from_millis(timeout.max(0) as u64),
|
||||
IsInterval::NonInterval,
|
||||
)
|
||||
}
|
||||
|
@ -908,7 +909,7 @@ impl WindowMethods for Window {
|
|||
self.upcast::<GlobalScope>().set_timeout_or_interval(
|
||||
callback,
|
||||
args,
|
||||
timeout,
|
||||
Duration::from_millis(timeout.max(0) as u64),
|
||||
IsInterval::Interval,
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue