From eb86fc20725ad7e5bb3c1a25bee9d47fad344577 Mon Sep 17 00:00:00 2001 From: Chun-Min Chang Date: Wed, 9 Oct 2019 16:36:12 -0700 Subject: [PATCH] Update type of MediaMetadata's artwork Since the entries in the MediaMetadata's `artwork` are frozen in the current spec [1], the type of the attribute `artwork` must be `FrozenArray` rather than `FrozenArray`. Otherwise the entries of artwork can not be frozen [2]. This change will address issue #237 The `artwork` in `MediaMetadataInit` and `MediaMetadata` will be clearly different after changing the `artwork` in `MediaMetadata` to `FrozenArray`, hence the _getter_, _setter_ of `artwork` and the _convert artwork algorithm_ should be updated to match the change. This change will address issue #176 [1] https://github.com/web-platform-tests/wpt/blob/801a2b3b5e1cd0192f31890ddf9ee7b4d0ad9e89/mediasession/mediametadata.html#L148 [2] https://tc39.es/ecma262/#sec-object.freeze --- index.bs | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/index.bs b/index.bs index 6468441..51bc5f6 100644 --- a/index.bs +++ b/index.bs @@ -1063,7 +1063,7 @@ interface MediaMetadata { attribute DOMString title; attribute DOMString artist; attribute DOMString album; - attribute FrozenArray<MediaImage> artwork; + attribute FrozenArray<object> artwork; [SameObject] readonly attribute FrozenArray<ChapterInformation> chapterInfo; }; @@ -1095,7 +1095,8 @@ dictionary MediaMetadataInit {

A {{MediaMetadata}} has an associated list of artwork - images. + images which is a list of type object on the interface + but a list of type {{MediaImage}} internally.

@@ -1139,9 +1140,10 @@ dictionary MediaMetadataInit {

  • Run the convert artwork algorithm with init's - {{MediaMetadataInit/artwork}} as input and set - metadata's artwork images as the - result if it succeeded. + {{MediaMetadataInit/artwork}} as input, + where the input is a list of type {{MediaImage}}, + and set metadata's artwork images + as the result if it succeeded.
  • Let chapters be an empty list of type {{ChapterInformation}}. @@ -1164,7 +1166,8 @@ dictionary MediaMetadataInit {

    When the convert artwork algorithm with input parameter is -invoked, the user agent MUST run the following steps: +invoked, where the input is a list of type {{MediaImage}}, +the user agent MUST run the following steps:
    1. Let output be an empty list of type {{MediaImage}}. @@ -1230,7 +1233,7 @@ invoked, the user agent MUST run the following steps: images. On getting, it MUST return the result of the following steps:
      1. - Let frozenArtwork be an empty list of type {{MediaImage}}. + Let frozenArtwork be an empty list of type object.
      2. For each entry in the {{MediaMetadata}}'s image's {{MediaImage/type}} to entry's {{MediaImage/type}}.
      3. +
      4. + Convert image into an object + whose type is object. +