w3c/mediasession

Initialize dictionary members where the dictionaries are instantiated

Opened this issue · 1 comments

The MediaSessionActionDetails dictionary and two inheriting dictionaries are created at step 5 of handle media session action, like this:

Run handler with the details parameter set to:

  • MediaSessionSeekActionDetails if action is seekbackward or seekforward.
  • MediaSessionSeekToActionDetails if action is seekto.
  • Otherwise, with MediaSessionActionDetails.

This isn't quite right, because MediaSessionActionDetails and friends are dictionary types, not values. Storage has an example of phrasing for this:

Let dictionary be a new StorageEstimate dictionary whose usage member is usage and quota member is quota.

The effect of having the spell out the values at the creation site rather than in the description of the dictionary members is the main reason I'm filing this issue, to make it clearer when for example seekOffset is absent.

Something like:

Run handler with the details parameter set to:

  • If action is seekbackward or seekforward, a new MediaSessionSeekActionDetails dictionary whose action member is action and seekOffset member is ???.
  • If action is seekto, a new MediaSessionSeekToActionDetails dictionary whose action member is action, seekTime member is ???, and fastSeek member is ???.
  • Otherwise, a new MediaSessionActionDetails dictionary whose action member is action.

Aside: whatwg/infra#102 would have been handy here.

Marking as Ready for PR and editorial in the sense this is a clarification and does not change the behavior.