w3c / user-timing

User Timing
https://w3c.github.io/user-timing/
Other
26 stars 24 forks source link

Clarify behavior when `detail` is omitted from `PerformanceMeasureOptions` #74

Closed samweinig closed 4 years ago

samweinig commented 4 years ago

Step #9 of https://w3c.github.io/user-timing/#dom-performance-measure states:

`

  1. Set entry's detail attribute as follows:
    1. If startOrMeasureOptions is a PerformanceMeasureOptions object:
      1. Let record be the result of calling the StructuredSerialize algorithm on startOrMeasureOptions's detail.
      2. Set entry's detail to the result of calling the StructuredDeserialize algorithm on record and the current realm.
    2. Otherwise, set it to null. `

This does not handle the case where startOrMeasureOptions is a PerformanceMeasureOptions but detail is not present. From the tests, it seems like the desired behavior is to set entry's detail to null here.

This can be clarified by changing 9.1. from:

If startOrMeasureOptions is a PerformanceMeasureOptions object:

to

If startOrMeasureOptions is a PerformanceMeasureOptions object and its detail member is present: