Skip to content

Commit

Permalink
Add the ability to share files (#133)
Browse files Browse the repository at this point in the history
Add a `files` member to ShareData dictionary.

Co-authored-by: Eric Willigers <ericwilligers@chromium.org>
  • Loading branch information
Marcos Cáceres and ericwilligers committed May 14, 2020
1 parent 3801fcf commit f615649
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions index.html
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;
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

0 comments on commit f615649

Please sign in to comment.