mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
LibWeb: Report performance based timestamps relative to ESO time origin
This commit is contained in:
parent
8963e62a5e
commit
7488136a51
Notes:
github-actions[bot]
2025-01-27 13:54:36 +00:00
Author: https://github.com/tcl3
Commit: 7488136a51
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3341
12 changed files with 248 additions and 28 deletions
|
@ -24,9 +24,7 @@ GC_DEFINE_ALLOCATOR(Performance);
|
|||
|
||||
Performance::Performance(JS::Realm& realm)
|
||||
: DOM::EventTarget(realm)
|
||||
, m_timer(Core::TimerType::Precise)
|
||||
{
|
||||
m_timer.start();
|
||||
}
|
||||
|
||||
Performance::~Performance() = default;
|
||||
|
@ -68,8 +66,8 @@ GC::Ptr<NavigationTiming::PerformanceNavigation> Performance::navigation()
|
|||
// https://w3c.github.io/hr-time/#timeorigin-attribute
|
||||
double Performance::time_origin() const
|
||||
{
|
||||
// FIXME: The timeOrigin attribute MUST return the number of milliseconds in the duration returned by get time origin timestamp for the relevant global object of this.
|
||||
return static_cast<double>(m_timer.origin_time().nanoseconds()) / 1e6;
|
||||
// The timeOrigin attribute MUST return the number of milliseconds in the duration returned by get time origin timestamp for the relevant global object of this.
|
||||
return get_time_origin_timestamp(HTML::relevant_principal_global_object(*this));
|
||||
}
|
||||
|
||||
// https://w3c.github.io/hr-time/#now-method
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue