Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to share files #133

Merged
merged 2 commits into from
May 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
};
</script>
</head>
<body>
<body data-cite="FILEAPI">
<section id="abstract">
<p>
This specification defines an API for sharing text, links and other
Expand Down Expand Up @@ -141,8 +141,17 @@ <h4>
rejected with</a> {{InvalidStateError}}.
</li>
<li>If none of |data|'s members {{ShareData/title}},
{{ShareData/text}}, or {{ShareData/url}} are present, return <a>a
promise rejected with</a> a {{TypeError}}.
{{ShareData/text}}, or {{ShareData/url}} or {{ShareData/file}} are
present, return <a>a promise rejected with</a> a {{TypeError}}.
</li>
<li>If |data|'s {{ShareData/files}} member is present:
<ol>
<li>If |data|'s {{ShareData/files}} member is empty, or if the
implementation does not support file sharing, return <a>a
promise rejected with</a> a {{TypeError}}, and abort these
steps.
</li>
</ol>
</li>
<li>If |data|'s {{ShareData/url}} member is present:
<ol>
Expand All @@ -163,7 +172,8 @@ <h4>
</ol>
</li>
<li>If the [=relevant global object=] of [=this=] does not have
[=transient activation=], return <a>a promise rejected with</a>
[=transient activation=], or a file type is being blocked due to
security considerations, return <a>a promise rejected with</a>
with a {{"NotAllowedError"}} {{DOMException}}.
</li>
<li>Set {{[[sharePromise]]}} to be <a>a new promise</a>.
Expand Down Expand Up @@ -244,6 +254,7 @@ <h3>
</h3>
<pre class="idl">
dictionary ShareData {
FrozenArray&lt;File&gt; files;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a sequence, no? We wouldn't expect a developer to pass in a frozen array (i.e., {files: Object.freeze(filesArray)}).

Suggested change
FrozenArray&lt;File&gt; files;
sequence&lt;File&gt; files;

USVString title;
USVString text;
USVString url;
Expand All @@ -254,6 +265,12 @@ <h3>
members:
</p>
<dl data-sort="">
<dt>
<dfn>files</dfn> member
</dt>
<dd>
Files to be shared.
</dd>
<dt>
<dfn>title</dfn> member
</dt>
Expand Down