From 1ec2746303512ecd3acc936e78ed2c9d3aa2766d Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Thu, 16 Apr 2026 13:35:48 +0100 Subject: [PATCH] Record task-like timing in fire an event Together with w3c/long-animation-frames#37 This allows clustering a "fire an event" timeframe in terms of frame timing monitoring, as opposed to relying on an "implicit document", which is a deprecated and non-interoperable term. The implication of this is that if this event firing schedules a render that ends up as a long animation frame, the whole event firing duration would be counted towards this performance entry, regardless of "tasks". See w3c/long-animation-frames#36 --- dom.bs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index 6dd773de..76c40585 100644 --- a/dom.bs +++ b/dom.bs @@ -1746,6 +1746,8 @@ optionally using an eventConstructor, with a description of how IDL a initialized, and a legacy target override flag, run these steps:
    +
  1. Let recordingTimingAsTask be the result of calling start recording task time if + needed given target's relevant settings object.

  2. If eventConstructor is not given, then let eventConstructor be {{Event}}. @@ -1760,8 +1762,19 @@ initialized, and a legacy target override flag, run these steps:

    This also allows for the {{Event/isTrusted}} attribute to be set to false. -

  3. Return the result of dispatching event at target, with +

  4. Let result be the result of dispatching event at target, with legacy target override flag set if set. + +

  5. If recordingTimingAsTask is true, then: + +

      +
    1. Assert: target's relevant settings object is a {{Document}}. + +

    2. Record task end time given the unsafe shared current time and target's + relevant settings object. +

    + +
  6. Return result.