From 8308e97d5a6804ce4e03f4b552927ce290baca00 Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Tue, 18 Mar 2025 13:26:25 -0700 Subject: [PATCH 1/9] Remove PerformanceEntry.id and rephrase id generation. - Removing PerformanceEntry.id, since it's shadowed by PerformanceElementTiming.id, see https://github.com/w3c/performance-timeline/issues/218 - Rephrasing how navigation ids are generated: - no more mention of id, but the mechanism is the same as before, a random navigation id for each new document, which is then incremented for navigations that don't change the document - changes the order of the sections for queing so that it first talks about navigation performance entries, since these change the navigation ids, and only after that other entries --- index.html | 80 +++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/index.html b/index.html index 09e12ae..8b23ca7 100644 --- a/index.html +++ b/index.html @@ -314,7 +314,6 @@

The PerformanceEntry interface

       [Exposed=(Window,Worker)]
       interface PerformanceEntry {
-        readonly    attribute unsigned long long  id;
         readonly    attribute DOMString           name;
         readonly    attribute DOMString           entryType;
         readonly    attribute DOMHighResTimeStamp startTime;
@@ -680,16 +679,28 @@ 

supportedEntryTypes attribute

Processing

-

Queue a PerformanceEntry

-

To queue a PerformanceEntry (newEntry), run +

Queue a navigation PerformanceEntry

+

To queue a navigation PerformanceEntry (newEntry), run these steps:

    -
  1. If newEntry's {{PerformanceEntry/id}} is unset: +
  2. Let id be the result of running generate a navigation id for newEntry.
  3. +
  4. Let relevantGlobal be newEntry's relevant + global object. +
  5. +
  6. Set newEntry's {{PerformanceEntry/navigationId}} to id.
  7. +
  8. If relevantGlobal has an [=associated document=]:
      -
    1. Let id be the result of running generate an id for newEntry.
    2. -
    3. Set newEntry's {{PerformanceEntry/id}} to id.
    4. +
    5. Set relevantGlobal's [=associated document=]'s [=most recent navigation=] to newEntry.
  9. +
  10. Queue a PerformanceEntry with newEntry as input.
  11. +
+
+
+

Queue a PerformanceEntry

+

To queue a PerformanceEntry (newEntry), run + these steps:

+
  1. Let interested observers be an initially empty set of PerformanceObserver objects.
  2. @@ -703,7 +714,7 @@

    Queue a PerformanceEntry

    1. Set newEntry's navigationId to the value of - relevantGlobal's [=associated document=]'s [=most recent navigation=]'s {{PerformanceEntry/id}}.
    2. + relevantGlobal's [=associated document=]'s [=most recent navigation=]'s {{PerformanceEntry/navigationId}}.
  3. Otherwise, set newEntry's Queue a PerformanceEntry
-
-

Queue a navigation PerformanceEntry

-

To queue a navigation PerformanceEntry (newEntry), run - these steps:

-
    -
  1. Let id be the result of running generate an id for newEntry.
  2. -
  3. Let relevantGlobal be newEntry's relevant - global object. -
  4. -
  5. Set newEntry's {{PerformanceEntry/id}} to id.
  6. -
  7. Set newEntry's {{PerformanceEntry/navigationId}} to id.
  8. -
  9. If relevantGlobal has an [=associated document=]: -
      -
    1. Set relevantGlobal's [=associated document=]'s [=most recent navigation=] to newEntry.
    2. -
    -
  10. -
  11. Queue a PerformanceEntry with newEntry as input.
  12. -
-

Queue the PerformanceObserver task

When asked to queue the PerformanceObserver task, given @@ -942,26 +934,27 @@

Determine if a performance entry buffer is full

-

Generate a Performance Entry id

-

When asked to generate an id for a +

Generate a Navigation id

+

When asked to generate a navigation id for a navigation PerformanceEntry entry, run the following steps:

  1. Let relevantGlobal be entry's relevant - global object. -
  2. Increase relevantGlobal's last performance entry - id by a small number chosen by the user agent.
  3. -
  4. Return relevantGlobal's last performance entry id. + global object. +
  5. If relevantGlobal has an [=associated document=] + with a [=most recent navigation=]: +
      +
    1. Return the sum of the [=most recent navigation=]'s + navigationId and a small integer. +
    +
  6. Otherwise return a random integer.
-

A user agent may choose to increase the last performance entry - idit by a small random integer every time. A user agent must not pick - a single global random integer and increase the last performance entry - id of all global objects by that amount because this could introduce - cross origin leaks. -

-

The last performance entry id has an initial random - value, and is increased by a small number chosen by the user agent instead - of 1 to discourage developers from considering it as a counter of the - number of entries that have been generated in the web application.

+

Sequences of navigation ids that are associated with + the same document can be used to establish order, by sorting by + navigation id.

+

The increcase between same-document navigation ids is + as small number as opposed to 1, to discourage developers from considering + navigation ids as a counter of the number of entries that have been generated + in the web application.

@@ -971,8 +964,9 @@

Privacy Considerations

refer to [[HR-TIME-3]] for privacy considerations of exposing high-resoluting timing information. Each new specification introducing new performance entries should have its own privacy considerations as well.

-

The last performance entry id is deliberately initialized to a +

The last navigation id is deliberately initialized to a random value, and is incremented by another small value every time a new + navigation {{PerformanceEntry}} is queued. User agents may choose to use a consistent increment for all users, or may pick a different increment for each global object, or may choose a new random increment for each From cc34a39c0c7ec2f69f9c35ed9b3f9a72f9b4821f Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Tue, 18 Mar 2025 13:44:01 -0700 Subject: [PATCH 2/9] typo --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 8b23ca7..ab1caf3 100644 --- a/index.html +++ b/index.html @@ -951,7 +951,7 @@

Generate a Navigation id

Sequences of navigation ids that are associated with the same document can be used to establish order, by sorting by navigation id.

-

The increcase between same-document navigation ids is +

The increcase between same-document navigation ids is as small number as opposed to 1, to discourage developers from considering navigation ids as a counter of the number of entries that have been generated in the web application.

From 07ffd9b2627c9ba23274df639a4eedec75a9f9d4 Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Wed, 19 Mar 2025 11:07:55 -0700 Subject: [PATCH 3/9] swap the queing sections for now --- index.html | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index ab1caf3..5f3bd1c 100644 --- a/index.html +++ b/index.html @@ -678,24 +678,6 @@

supportedEntryTypes attribute

Processing

-
-

Queue a navigation PerformanceEntry

-

To queue a navigation PerformanceEntry (newEntry), run - these steps:

-
    -
  1. Let id be the result of running generate a navigation id for newEntry.
  2. -
  3. Let relevantGlobal be newEntry's relevant - global object. -
  4. -
  5. Set newEntry's {{PerformanceEntry/navigationId}} to id.
  6. -
  7. If relevantGlobal has an [=associated document=]: -
      -
    1. Set relevantGlobal's [=associated document=]'s [=most recent navigation=] to newEntry.
    2. -
    -
  8. -
  9. Queue a PerformanceEntry with newEntry as input.
  10. -
-

Queue a PerformanceEntry

To queue a PerformanceEntry (newEntry), run @@ -764,6 +746,24 @@

Queue a PerformanceEntry

+
+

Queue a navigation PerformanceEntry

+

To queue a navigation PerformanceEntry (newEntry), run + these steps:

+
    +
  1. Let id be the result of running generate a navigation id for newEntry.
  2. +
  3. Let relevantGlobal be newEntry's relevant + global object. +
  4. +
  5. Set newEntry's {{PerformanceEntry/navigationId}} to id.
  6. +
  7. If relevantGlobal has an [=associated document=]: +
      +
    1. Set relevantGlobal's [=associated document=]'s [=most recent navigation=] to newEntry.
    2. +
    +
  8. +
  9. Queue a PerformanceEntry with newEntry as input.
  10. +
+

Queue the PerformanceObserver task

When asked to queue the PerformanceObserver task, given From dd6399b26bd47e10d609c15a5f2013acb58ed40b Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Fri, 21 Mar 2025 12:03:19 -0700 Subject: [PATCH 4/9] Make navigationId an int32, and simplify algorithm. --- index.html | 70 +++++++++++++++++++++--------------------------------- 1 file changed, 27 insertions(+), 43 deletions(-) diff --git a/index.html b/index.html index 5f3bd1c..683d441 100644 --- a/index.html +++ b/index.html @@ -247,15 +247,12 @@

Performance Timeline

  • An integer dropped entries count that is initially 0.
  • -
  • An integer last performance entry id that is initially set - to a random integer between 100 and 10000. +
  • An integer current navigation id, which is initially 0.
  • Each Document has:

      -
    • A most recent navigation, which is a PerformanceEntry, - initially unset. -
    • + An integer current navigation id, which is initially 0.

    In order to get the relevant performance entry tuple, given entryType and globalObject as input, run the @@ -318,7 +315,7 @@

    The PerformanceEntry interface

    readonly attribute DOMString entryType; readonly attribute DOMHighResTimeStamp startTime; readonly attribute DOMHighResTimeStamp duration; - readonly attribute unsigned long long navigationId; + readonly attribute long navigationId; [Default] object toJSON(); };
    @@ -331,9 +328,8 @@

    The PerformanceEntry interface

    This attribute must return the value it is initialized to. -

    All `entryType` values are defined in the - relevantregistry. +

    All `entryType` values are defined in the relevant + registry. Examples include: "mark" and "measure" [[USER-TIMING-2]], "navigation" [[NAVIGATION-TIMING-2]], and "resource" [[RESOURCE-TIMING-2]].

    @@ -686,21 +682,20 @@

    Queue a PerformanceEntry

  • Let interested observers be an initially empty set of PerformanceObserver objects.
  • -
  • Let entryType be newEntry’s Let entryType be newEntry's entryType value.
  • Let relevantGlobal be newEntry's relevant global object.
  • -
  • If relevantGlobal has an [=associated document=]: -
      -
    1. Set newEntry's navigationId to the value of - relevantGlobal's [=associated document=]'s [=most recent navigation=]'s {{PerformanceEntry/navigationId}}.
    2. -
    +
  • If the PerformanceEntry to be queued is a navigation + entry (in other words, entryType=='navigation'), then + let navigationId be the result of running + generate a navigation id. Otherwise, let navigationId + be the relevantGlobal’s current navigation id.
  • -
  • Otherwise, set newEntry's navigationId to null.
  • +
  • Set newEntry's navigationId to navigationId.
  • For each registered performance observer regObs in relevantGlobal's list of registered performance observer objects:
      @@ -746,24 +741,6 @@

      Queue a PerformanceEntry

    -
    -

    Queue a navigation PerformanceEntry

    -

    To queue a navigation PerformanceEntry (newEntry), run - these steps:

    -
      -
    1. Let id be the result of running generate a navigation id for newEntry.
    2. -
    3. Let relevantGlobal be newEntry's relevant - global object. -
    4. -
    5. Set newEntry's {{PerformanceEntry/navigationId}} to id.
    6. -
    7. If relevantGlobal has an [=associated document=]: -
        -
      1. Set relevantGlobal's [=associated document=]'s [=most recent navigation=] to newEntry.
      2. -
      -
    8. -
    9. Queue a PerformanceEntry with newEntry as input.
    10. -
    -

    Queue the PerformanceObserver task

    When asked to queue the PerformanceObserver task, given @@ -940,13 +917,18 @@

    Generate a Navigation id

    1. Let relevantGlobal be entry's relevant global object. -
    2. If relevantGlobal has an [=associated document=] - with a [=most recent navigation=]: -
        -
      1. Return the sum of the [=most recent navigation=]'s - navigationId and a small integer. -
      -
    3. Otherwise return a random integer. +
    4. Let relevantDoc be relevantGlobal's [=associated document=], or null. +
    5. If relevantGlobal's [=current navigation id=] is 0 (the initial value), + of if relevantDoc is null, + or if relevantDoc is not null and relevantGlobal's + [=current navigation id=] differs from doc's [=current navigation id=], + then let navigationId be a random integer between 100 and 10000000. +
    6. Otherwise, let navigationId be relevantGlobal's [=current navigation id=] + plus a small integer. +
    7. Set relevantGlobal's [=current navigation id=] to navigationId. +
    8. If relevantDoc is not null, set relevantDoc's [=current navigation id=] + to navigationId. +
    9. Return navigationId.

    Sequences of navigation ids that are associated with the same document can be used to establish order, by sorting by @@ -955,6 +937,8 @@

    Generate a Navigation id

    as small number as opposed to 1, to discourage developers from considering navigation ids as a counter of the number of entries that have been generated in the web application.

    +

    To avoid integer overflow, the same-document mechanism may revert to assign + a random integer between 10 and 10000000, but this is expected to be extremeley rare.

    From 7da63a6cd72914b7052b17f8144f135c57698316 Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Fri, 21 Mar 2025 12:09:26 -0700 Subject: [PATCH 5/9] distinguish current document navigation id --- index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 683d441..2c4c756 100644 --- a/index.html +++ b/index.html @@ -252,7 +252,7 @@

    Performance Timeline

    Each Document has:

      - An integer current navigation id, which is initially 0. + An integer current document navigation id, which is initially 0.

    In order to get the relevant performance entry tuple, given entryType and globalObject as input, run the @@ -691,7 +691,9 @@

    Queue a PerformanceEntry

  • If the PerformanceEntry to be queued is a navigation entry (in other words, entryType=='navigation'), then let navigationId be the result of running - generate a navigation id. Otherwise, let navigationId + generate a navigation id. +
  • +
  • Otherwise, let navigationId be the relevantGlobal’s current navigation id.
  • Set newEntry's Generate a Navigation id
  • If relevantGlobal's [=current navigation id=] is 0 (the initial value), of if relevantDoc is null, or if relevantDoc is not null and relevantGlobal's - [=current navigation id=] differs from doc's [=current navigation id=], + [=current navigation id=] differs from doc's [=current document navigation id=], then let navigationId be a random integer between 100 and 10000000.
  • Otherwise, let navigationId be relevantGlobal's [=current navigation id=] plus a small integer.
  • Set relevantGlobal's [=current navigation id=] to navigationId. -
  • If relevantDoc is not null, set relevantDoc's [=current navigation id=] +
  • If relevantDoc is not null, set relevantDoc's [=current document navigation id=] to navigationId.
  • Return navigationId. From 9d78e2d2c113a5b14db053336127256c380c3186 Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Fri, 21 Mar 2025 12:11:42 -0700 Subject: [PATCH 6/9] tweak wording --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2c4c756..e0e3c5d 100644 --- a/index.html +++ b/index.html @@ -925,8 +925,8 @@

    Generate a Navigation id

    or if relevantDoc is not null and relevantGlobal's [=current navigation id=] differs from doc's [=current document navigation id=], then let navigationId be a random integer between 100 and 10000000. -
  • Otherwise, let navigationId be relevantGlobal's [=current navigation id=] - plus a small integer. +
  • Otherwise, let navigationId be the sum of relevantGlobal's + [=current navigation id=] and a small integer.
  • Set relevantGlobal's [=current navigation id=] to navigationId.
  • If relevantDoc is not null, set relevantDoc's [=current document navigation id=] to navigationId. From 58b39fbab3358318018e2c210406667eebbbb392 Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Fri, 30 May 2025 16:04:42 -0700 Subject: [PATCH 7/9] Make navigationId an unsigned integer, since we wont' use the sign anyway. --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index e0e3c5d..18e3702 100644 --- a/index.html +++ b/index.html @@ -119,7 +119,7 @@

    Introduction

    and be notified of new performance metrics and, optionally, previously buffered performance metrics of specified type, via the
    PerformanceObserver interface.

    -

    The PerformanceObserver interface was added +

    The PerformanceObserver interface was added and is designed to address limitations of the buffer-based approach shown in the first example. By using the PerformanceObserver interface, the application can:

    @@ -315,7 +315,7 @@

    The PerformanceEntry interface

    readonly attribute DOMString entryType; readonly attribute DOMHighResTimeStamp startTime; readonly attribute DOMHighResTimeStamp duration; - readonly attribute long navigationId; + readonly attribute unsigned long navigationId; [Default] object toJSON(); };
    From 3ffe8339aca47bf34a5f87afac3bf561e4d60743 Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Fri, 30 May 2025 16:31:14 -0700 Subject: [PATCH 8/9] tweaks --- index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 927dee2..4b02cfe 100644 --- a/index.html +++ b/index.html @@ -913,7 +913,7 @@

    Determine if a performance entry buffer is full

    Generate a Navigation id

    When asked to generate a navigation id for a navigation - PerformanceEntry entry, run the following steps:

    + PerformanceEntry entry, run the following steps:

    1. Let relevantGlobal be entry's relevant global object. @@ -948,7 +948,7 @@

      Privacy Considerations

      refer to [[HR-TIME-3]] for privacy considerations of exposing high-resoluting timing information. Each new specification introducing new performance entries should have its own privacy considerations as well.

      -

      The last navigation id is deliberately initialized to a +

      The current navigation id is deliberately initialized to a random value, and is incremented by another small value every time a new navigation {{PerformanceEntry}} is queued. User agents may choose to use a consistent From 4524f6c83b39ca90d210597cdf923b67cc45184c Mon Sep 17 00:00:00 2001 From: Johannes Henkel Date: Fri, 30 May 2025 16:37:58 -0700 Subject: [PATCH 9/9] fix markup --- index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 4b02cfe..c6a5e9a 100644 --- a/index.html +++ b/index.html @@ -252,7 +252,9 @@

      Performance Timeline

      Each Document has:

        - An integer current document navigation id, which is initially 0. +
      • + An integer current document navigation id, which is initially 0. +

      In order to get the relevant performance entry tuple, given entryType and globalObject as input, run the