ladybird/Libraries/LibWeb/HighResolutionTime/Performance.idl
Luke Wilde da5fca15ee LibWeb: Only expose performance.{timing,navigation} on Window
They are only valid in a Window context, and the spec only exposes them
in Window contexts.

Fixes workers crashing on:
- https://web.whatsapp.com/
- https://pro.kraken.com/app/trade/btc-usd
2025-07-25 11:46:58 +02:00

38 lines
1.9 KiB
Text

#import <DOM/EventTarget.idl>
#import <HighResolutionTime/DOMHighResTimeStamp.idl>
#import <NavigationTiming/PerformanceExtensions.idl>
#import <NavigationTiming/PerformanceNavigation.idl>
#import <NavigationTiming/PerformanceTiming.idl>
#import <PerformanceTimeline/PerformanceEntry.idl>
#import <UserTiming/PerformanceMark.idl>
#import <UserTiming/PerformanceMeasure.idl>
// https://www.w3.org/TR/performance-timeline/#dom-performanceentrylist
typedef sequence<PerformanceEntry> PerformanceEntryList;
// https://w3c.github.io/hr-time/#sec-performance
[Exposed=(Window, Worker)]
interface Performance : EventTarget {
DOMHighResTimeStamp now();
readonly attribute DOMHighResTimeStamp timeOrigin;
[Default] object toJSON();
// https://w3c.github.io/user-timing/#extensions-performance-interface
// "User Timing" extensions to the Performance interface
PerformanceMark mark(DOMString markName, optional PerformanceMarkOptions markOptions = {});
undefined clearMarks(optional DOMString markName);
PerformanceMeasure measure(DOMString measureName, optional (DOMString or PerformanceMeasureOptions) startOrMeasureOptions = {}, optional DOMString endMark);
undefined clearMeasures(optional DOMString measureName);
// https://w3c.github.io/resource-timing/#sec-extensions-performance-interface
// "Resource Timing" extensions to the Performance interface
undefined clearResourceTimings();
undefined setResourceTimingBufferSize(unsigned long maxSize);
attribute EventHandler onresourcetimingbufferfull;
// https://www.w3.org/TR/performance-timeline/#extensions-to-the-performance-interface
// "Performance Timeline" extensions to the Performance interface
PerformanceEntryList getEntries();
PerformanceEntryList getEntriesByType(DOMString type);
PerformanceEntryList getEntriesByName(DOMString name, optional DOMString type);
};