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 clipboard IDL description. #158

Merged
merged 31 commits into from
Mar 8, 2022
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
03fe049
Add clipboard IDL description.
snianu Oct 5, 2021
51c8bc5
Fix bikeshed error.
snianu Oct 5, 2021
34a50d0
Address comments.
snianu Oct 6, 2021
2f673f9
Fix error.
snianu Oct 6, 2021
639cc97
Fix error.
snianu Oct 6, 2021
55548e6
Revert "Address comments."
snianu Oct 6, 2021
3bb6d28
Address comments.
snianu Oct 6, 2021
eadb6df
Address comments.
snianu Oct 14, 2021
c77e6ca
Addressed review comments.
snianu Nov 2, 2021
713cf1e
Address review comments.
snianu Nov 3, 2021
2249e8b
Add conversion of DOMString to Blob type.
snianu Nov 3, 2021
3065ce8
Address PR comments.
snianu Nov 5, 2021
d42241d
Addressed comments.
snianu Nov 11, 2021
bf13db2
Address PR comments.
snianu Nov 16, 2021
5965fc3
Fix bikeshed error.
snianu Nov 16, 2021
ce51957
Address PR comments.
snianu Nov 19, 2021
7605ea3
Address PR comments.
snianu Nov 20, 2021
ca32200
Address PR comments.
snianu Dec 13, 2021
0bbf8a8
Address review comments.
snianu Jan 3, 2022
e77dc67
Address more review comments.
snianu Jan 4, 2022
68da098
Address review comments.
snianu Jan 4, 2022
9c96efc
Address review comments.
snianu Jan 6, 2022
eb8c313
Address PR comments.
snianu Jan 6, 2022
8b475d5
Address PR comments.
snianu Jan 19, 2022
c2f9c38
Address PR comments.
snianu Jan 22, 2022
5ab3eab
Address comments.
snianu Feb 1, 2022
4f9b71c
Address comments.
snianu Feb 2, 2022
9694d17
Address comments.
snianu Feb 4, 2022
fd317ba
Address comments.
snianu Feb 15, 2022
02c7b2b
Address PR comments.
snianu Mar 1, 2022
0ab5153
Address comment.
snianu Mar 2, 2022
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
15 changes: 10 additions & 5 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
<div id="navigator-idl" dfn-for="Navigator">

<div class="algorithm" data-algorithm="navigator-clipboard">
<h4 id="h-navigator-clipboard">clipboard</h4>
<h4 id="h-navigator-clipboard"><dfn>clipboard</dfn></h4>
It is used to execute read/write operations from/to the [=system clipboard=].
The {{Navigator/clipboard}} getter steps are to return [=this=]'s [=clipboard=] object.
</div>
Expand Down Expand Up @@ -655,7 +655,7 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
The <dfn constructor for="ClipboardItem" lt="ClipboardItem(items, options)"><code>new ClipboardItem(<var>items</var>, <var>options</var>)</code></dfn> constructor steps are:
1. If |items| is empty, then throw a {{TypeError}}.

1. If |options| is empty, then set |options| to "unspecified".
1. If |options| is empty, then set options["presentationStyle"] = "unspecified".

1. Set [=this=]'s [=ClipboardItem/clipboard item=] to a new [=/clipboard item=].

Expand Down Expand Up @@ -757,9 +757,8 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
};
</pre>

Some methods of the {{Clipboard}} interface take or return multiple {{ClipboardItem}} objects. However, not all platforms support more than one [=/clipboard item=]; on such platforms, the algorithms below will ignore any {{ClipboardItem}} objects beyond the first one that are passed to {{Clipboard/write()}}, and {{Clipboard/read()}} and {{Clipboard/readText()}} will only ever return a single-item array.
Some methods of the {{Clipboard}} interface take or return multiple {{ClipboardItem}} objects. However, not all platforms support more than one [=/clipboard item=]; on such platforms, the algorithms below will ignore any {{ClipboardItem}} objects beyond the first one that are passed to {{Clipboard/write()}}, and {{Clipboard/read()}} and {{Clipboard/readText()}} only get one clipboard item from the OS.

A {{Clipboard}} object has an associated <dfn>clipboard</dfn>.
A <dfn>clipboard items</dfn> object is a [=sequence=] of [=/clipboard item=]s.

<p class="note">
Expand Down Expand Up @@ -790,6 +789,8 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;

1. Let |data| be a copy of the [=system clipboard data=] represented as [=clipboard items=]. For the MIME types defined in the [=mandatory data types=] list, |data| contains the sanitized copy of text/html format, but image/png format has unsanitized payload to preserve meta data.
snianu marked this conversation as resolved.
Show resolved Hide resolved
snianu marked this conversation as resolved.
Show resolved Hide resolved

Issue: Some OSs contain multiple clipboard (e.g. Linux, "primary", "secondary", "selection"). Define from which of those data is read.

Note: As further described in [[#image-transcode]] this explicitly does not transcode images.
Rather the original unmodified image data should be exposed to the website.

Expand Down Expand Up @@ -839,11 +840,13 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;

1. Let |data| be a copy of the [=system clipboard data=] represented as [=clipboard items=]. For the MIME types defined in the [=mandatory data types=] list, |data| contains the sanitized copy of text/plain format.
snianu marked this conversation as resolved.
Show resolved Hide resolved
snianu marked this conversation as resolved.
Show resolved Hide resolved

Issue: Some OSs contain multiple clipboard (e.g. Linux, "primary", "secondary", "selection"). Define from which of those data is read.

Issue: Add definition of sanitized copy.

1. [=Queue a global task=] on the [=clipboard task source=], given |realm|'s [=Realm/global object=], to perform the below steps:

1. Let |dataList| be a [=sequence=]&lt;{{ClipboardItem}}&gt;.
1. Let |dataList| be a [=sequence=] of [=/clipboard item=]s.

1. If |data|'s [=list/size=] is greater than 1, then add |data|[0] to |dataList|.

Expand Down Expand Up @@ -1621,6 +1624,8 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;

1. Insert |payload| and |presentationStyle| into the [=system clipboard=] using |formatString| as the native clipboard format.

Issue: some OSs contain multiple clipboard (e.g. Linux, "primary", "secondary", "selection"). Define from which of those data is written.
snianu marked this conversation as resolved.
Show resolved Hide resolved

</div><!-- algorithm -->

<div class="algorithm" data-algorithm="os-specific-well-known-format">
Expand Down