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:
Martin Robinson 2024-08-30 17:20:44 +02:00 committed by GitHub
parent 8a0c7487e7
commit a4ceb82ef5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 78 additions and 106 deletions

View file

@ -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 {