Commit graph

6 commits

Author SHA1 Message Date
Martin Chrástek
9f3cf862e8 LibWeb: Fix PerformanceTiming getters producing wrong wall clock values
PerformanceTiming::monotonic_timestamp_to_wall_time_milliseconds
assumes all DocumentLoadTimingInfo values are monotonic timestamps
and converts them via wall_time = timestamp - epoch. This is correct
for navigation_start_time (a true monotonic timestamp), but wrong
for all other timing fields like load_event_end_time, dom_complete_time
etc., which are stored as relative timestamps via
current_high_resolution_time() (relative to time origin).

The computed wall clock value ends up off by navigation_start_time,
causing convert_name_to_timestamp() to return wrapped-around u64
values. This broke performance.measure() when using navigation timing
attribute names as start/end marks.

Add relative_timestamp_to_wall_time_milliseconds which adds back
navigation_start_time before the epoch subtraction, producing correct
UTC epoch ms for these fields.
2026-05-19 19:22:11 +02:00
Aliaksandr Kalenik
901cc28272 LibWeb: Reduce recompilation impact of DOM/Document.h
Remove 11 heavy includes from Document.h that were only needed for
pointer/reference types (already forward-declared in Forward.h), and
extract the nested ViewportClient interface to a standalone header.

This reduces Document.h's recompilation cascade from ~1228 files to
~717 files (42% reduction). Headers like BrowsingContext.h that were
previously transitively included see even larger improvements (from
~1228 down to ~73 dependents).
2026-02-11 20:02:28 +01:00
Tim Ledbetter
05351dfe45 LibWeb: Return wall time from PerformanceTiming interface
This matches the behavior of other browsers.
2025-01-27 14:53:33 +01:00
Tim Ledbetter
e03fec2a15 LibWeb: Use DocumentLoadTimingInfo values in PerformanceTiming interface 2025-01-11 11:11:52 +01:00
Shannon Booth
f87041bf3a LibGC+Everywhere: Factor out a LibGC from LibJS
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
2024-11-15 14:49:20 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h (Browse further)