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
|
@ -4,12 +4,13 @@
|
|||
|
||||
use std::str::FromStr;
|
||||
use std::sync::LazyLock;
|
||||
use std::time::Duration;
|
||||
|
||||
use dom_struct::dom_struct;
|
||||
use html5ever::{LocalName, Prefix};
|
||||
use js::rust::HandleObject;
|
||||
use regex::bytes::Regex;
|
||||
use script_traits::{HistoryEntryReplacement, MsDuration};
|
||||
use script_traits::HistoryEntryReplacement;
|
||||
use servo_url::ServoUrl;
|
||||
use style::str::HTML_SPACE_CHARACTERS;
|
||||
|
||||
|
@ -207,7 +208,7 @@ impl HTMLMetaElement {
|
|||
window: window.clone(),
|
||||
url: url_record,
|
||||
}),
|
||||
MsDuration::new(time.saturating_mul(1000)),
|
||||
Duration::from_secs(time),
|
||||
);
|
||||
document.set_declarative_refresh(DeclarativeRefresh::CreatedAfterLoad);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue