Skip to content

Commit

Permalink
Default FilePickerAcceptType.description to the empty string (#423)
Browse files Browse the repository at this point in the history
This has no behavioral changes, since not specifying the description field currently behaves the same as if the description was specified as the empty string

Fixes #422
  • Loading branch information
a-sully committed Jun 23, 2023
1 parent 739b0c4 commit d8f5556
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ enum WellKnownDirectory {
typedef (WellKnownDirectory or FileSystemHandle) StartInDirectory;

dictionary FilePickerAcceptType {
USVString description;
USVString description = "";
record<USVString, (USVString or sequence<USVString>)> accept;
};

Expand Down Expand Up @@ -452,9 +452,6 @@ run these steps:
1. Let |accepts options| be a empty [=/list=] of [=tuples=]
consisting of a description and a filter.
1. [=list/For each=] |type| of |options|["{{FilePickerOptions/types}}"]:
1. Let |description| be |type|["{{FilePickerAcceptType/description}}"] if
|type|["{{FilePickerAcceptType/description}}"] [=map/exists=];
otherwise the empty string.
1. [=map/For each=] |typeString| → |suffixes| of
|type|["{{FilePickerAcceptType/accept}}"]:
1. Let |parsedType| be the result of [=parse a MIME type=] with |typeString|.
Expand All @@ -479,6 +476,7 @@ run these steps:
1. If |filename| ends with |suffix|, return `true`.
1. Return `false`.

1. Let |description| be |type|["{{FilePickerAcceptType/description}}"].
1. If |description| is an empty string,
set |description| to some user understandable string describing |filter|.

Expand Down

0 comments on commit d8f5556

Please sign in to comment.