diff --git a/dom.bs b/dom.bs index a0e8389cc..b5c8d639e 100644 --- a/dom.bs +++ b/dom.bs @@ -55,6 +55,11 @@ urlPrefix: https://w3c.github.io/ServiceWorker/#; spec: SERVICE-WORKERS urlPrefix: https://tc39.github.io/ecma262/#; spec: ECMASCRIPT text: Construct; url: sec-construct; type: abstract-op text: Realm; url: realm; type: dfn +urlPrefix: https://w3c.github.io/hr-time/#; spec: HR-TIME + type:typedef; urlPrefix: dom-; text: DOMHighResTimeStamp + type:dfn; text: time origin + type:dfn; text: clock resolution +
@@ -465,7 +470,7 @@ interface Event { readonly attribute boolean composed; [Unforgeable] readonly attribute boolean isTrusted; - readonly attribute DOMTimeStamp timeStamp; + readonly attribute DOMHighResTimeStamp timeStamp; void initEvent(DOMString type, optional boolean bubbles = false, optional boolean cancelable = false); // historical }; @@ -571,8 +576,8 @@ algorithm below. false otherwise.
event . {{Event/timeStamp}}
- type
attribute must
@@ -704,15 +709,12 @@ initialized to false.
the user agent to dispatch an event whose {{Event/isTrusted}} attribute is initialized to
false.
-The timeStamp
attribute
-must return the value it was initialized to. When an
-event is created the attribute must be
-initialized to the number of milliseconds that have passed since
-00:00:00 UTC on 1 January 1970, ignoring leap seconds.
-
+The timeStamp
attribute must return the value it was
+initialized to.
-This is highly likely to change and already does not reflect implementations well. -Please see dom #23 for more details. +
User agents are strongly encouraged to set minimum resolution of the +{{Event/timeStamp}} attribute to 5 microseconds following the existing clock resolution +recommendation. [[!HR-TIME]]
Initialize event's {{Event/type}} attribute to type. +
Initialize event's {{Event/timeStamp}} attribute to a {{DOMHighResTimeStamp}} + representing the high resolution time from the time origin to the occurrence of the call + to the event's constructor. +
For each dictionary member present in eventInitDict, find the attribute on event whose identifier matches the key of the dictionary member and then set the attribute to the value of that dictionary member. @@ -849,6 +855,16 @@ it, and optionally given a Realm realm, run these steps:
dictionary member and then set the attribute to the default value of that dictionary member. +Set event's {{Event/timeStamp}} attribute to a {{DOMHighResTimeStamp}} + representing the high resolution time from the time origin to the occurrence that the + event is signaling. + +
For example, in macOS the occurrence time for input actions are available via the
+ timestamp property of corresponding NSEvent
objects. So in this case, the
+ {{Event/timeStamp}} value should be equivalent to the NSEvent
's timestamp offset by
+ time origin, translated in milliseconds, and with its precision adjusted to meet the
+ recommended minimum clock resolution.
+
Initialize event's {{Event/isTrusted}} attribute to true.
Return event. @@ -5111,6 +5127,9 @@ invoked, must run these steps:
Initialize event's {{Event/type}} attribute to the empty string. +
Initialize event's {{Event/timeStamp}} attribute to a {{DOMHighResTimeStamp}} + representing the high resolution time from the time origin to now. +
Initialize event's {{Event/isTrusted}} attribute to false.
Unset event's initialized flag. @@ -9517,6 +9536,9 @@ other chapters are defined by the UI Events specification.