Commit graph

8 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
Shannon Booth
fd44da6829 LibWeb/Bindings: Emit one bindings header and cpp per IDL
Previously, the LibWeb bindings generator would output multiple per
interface files like Prototype/Constructor/Namespace/GlobalMixin
depending on the contents of that IDL file.

This complicates the build system as it means that it does not know
what files will be generated without knowledge of the contents of that
IDL file.

Instead, for each IDL file only generate a single Bindings/<IDLFile>.h
and Bindings/<IDLFile>.cpp.
2026-04-21 07:36:13 +02:00
Timothy Flynn
7280ed6312 Meta: Enforce newlines around namespaces
This has come up several times during code review, so let's just enforce
it using a new clang-format 20 option.
2025-05-14 02:01:59 -06:00
Andreas Kling
a6dfc74e93 LibWeb: Only set prototype once for object with IDL interface
Before this change, we were going through the chain of base classes for
each IDL interface object and having them set the prototype to their
prototype.

Instead of doing that, reorder things so that we set the right prototype
immediately in Foo::initialize(), and then don't bother in all the base
class overrides.

This knocks off a ~1% profile item on Speedometer 3.
2025-04-20 18:43:11 +02: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.cpp (Browse further)