mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-02 22:29:10 +00:00
LibWeb: Implement "current high resolution time" AO
This commit is contained in:
parent
144e53a209
commit
33bd6cfc2a
Notes:
sideshowbarker
2024-07-17 22:09:47 +09:00
Author: https://github.com/shannonbooth
Commit: 33bd6cfc2a
Pull-request: https://github.com/SerenityOS/serenity/pull/23935
2 changed files with 9 additions and 0 deletions
|
@ -27,6 +27,14 @@ DOMHighResTimeStamp coarsen_time(DOMHighResTimeStamp timestamp, bool cross_origi
|
|||
return timestamp;
|
||||
}
|
||||
|
||||
// https://w3c.github.io/hr-time/#dfn-current-high-resolution-time
|
||||
DOMHighResTimeStamp current_high_resolution_time(JS::Object const& global)
|
||||
{
|
||||
// The current high resolution time given a global object current global must return the result
|
||||
// of relative high resolution time given unsafe shared current time and current global.
|
||||
return HighResolutionTime::relative_high_resolution_time(HighResolutionTime::unsafe_shared_current_time(), global);
|
||||
}
|
||||
|
||||
// https://w3c.github.io/hr-time/#dfn-relative-high-resolution-time
|
||||
DOMHighResTimeStamp relative_high_resolution_time(DOMHighResTimeStamp time, JS::Object const& global)
|
||||
{
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace Web::HighResolutionTime {
|
|||
|
||||
DOMHighResTimeStamp get_time_origin_timestamp(JS::Object const&);
|
||||
DOMHighResTimeStamp coarsen_time(DOMHighResTimeStamp timestamp, bool cross_origin_isolated_capability = false);
|
||||
DOMHighResTimeStamp current_high_resolution_time(JS::Object const&);
|
||||
DOMHighResTimeStamp relative_high_resolution_time(DOMHighResTimeStamp, JS::Object const&);
|
||||
DOMHighResTimeStamp relative_high_resolution_coarsen_time(DOMHighResTimeStamp, JS::Object const&);
|
||||
DOMHighResTimeStamp coarsened_shared_current_time(bool cross_origin_isolated_capability = false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue