Bläddra i källkod

LibWeb/HighResolutionTime: Add IDL typedef for DOMHighResTimeStamp

We already have this for C++ code in DOMHighResTimeStamp.h, but let's
also avoid using plain 'double' in IDL code.
Linus Groh 2 år sedan
förälder
incheckning
2258fc273c

+ 2 - 0
Userland/Libraries/LibWeb/HighResolutionTime/DOMHighResTimeStamp.idl

@@ -0,0 +1,2 @@
+// https://w3c.github.io/hr-time/#dom-domhighrestimestamp
+typedef double DOMHighResTimeStamp;

+ 3 - 2
Userland/Libraries/LibWeb/HighResolutionTime/Performance.idl

@@ -1,11 +1,12 @@
 #import <DOM/EventTarget.idl>
 #import <DOM/EventTarget.idl>
+#import <HighResolutionTime/DOMHighResTimeStamp.idl>
 #import <NavigationTiming/PerformanceTiming.idl>
 #import <NavigationTiming/PerformanceTiming.idl>
 
 
 // https://w3c.github.io/hr-time/#sec-performance
 // https://w3c.github.io/hr-time/#sec-performance
 [Exposed=(Window, Worker)]
 [Exposed=(Window, Worker)]
 interface Performance : EventTarget {
 interface Performance : EventTarget {
-    double now();
-    readonly attribute double timeOrigin;
+    DOMHighResTimeStamp now();
+    readonly attribute DOMHighResTimeStamp timeOrigin;
 
 
     readonly attribute PerformanceTiming timing;
     readonly attribute PerformanceTiming timing;
 };
 };