Skip to content

Commit dbde687

Browse files
committed
New terminology: ClipboardItem entry as data type → value.
Right now, the spec refers to two things as "items": - A list of `ClipboardItem`s. - The individual data values inside a single `ClipboardItem`. This is rather confusing, so this PR proposes to rename the latter to "entries", where an entry conceptually corresponds to a data type (e.g. `"text/string"`) that maps to a value (e.g. a Blob). This: - Matches the JS naming convention (think of `Object.entries`). - Does not change any spec semantics, only the names of some identifiers. In addition, this PR also renames: - `ClipboardItemDataType` → `ClipboardItemValue`, and - `ClipboardItemData` → `ClipboardItemValuePromise`. This matches the "entry is a type type mapping to a value" convention, and makes it clear what is a Promise. The previous names may have caused a semantic typo (#126).
1 parent b56441b commit dbde687

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

index.bs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -589,16 +589,16 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
589589
Promise<void> writeText(DOMString data);
590590
};
591591

592-
typedef (DOMString or Blob) ClipboardItemDataType;
593-
typedef Promise<ClipboardItemDataType> ClipboardItemData;
592+
typedef (DOMString or Blob) ClipboardItemValue;
593+
typedef Promise<ClipboardItemValue> ClipboardEntryValuePromise;
594594

595-
callback ClipboardItemDelayedCallback = ClipboardItemData ();
595+
callback ClipboardItemDelayedCallback = ClipboardEntryValuePromise ();
596596

597597
[Exposed=Window] interface ClipboardItem {
598-
constructor(record<DOMString, ClipboardItemData> items,
598+
constructor(record<DOMString, ClipboardEntryValue> entries,
599599
optional ClipboardItemOptions options = {});
600600
static ClipboardItem createDelayed(
601-
record<DOMString, ClipboardItemDelayedCallback> items,
601+
record<DOMString, ClipboardEntryDelayedCallback> entries,
602602
optional ClipboardItemOptions options = {});
603603

604604
readonly attribute PresentationStyle presentationStyle;
@@ -820,7 +820,7 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
820820
1. Else, if the event was canceled, then
821821

822822
1. Call the [=write content to the clipboard=] algorithm,
823-
passing on the {{DataTransferItemList}} list <em>items</em>,
823+
passing on the {{DataTransferItemList}} list <em>entries</em>,
824824
a <em>clear-was-called</em> flag and a <em>types-to-clear</em>
825825
list.
826826

@@ -1302,14 +1302,14 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
13021302
<h3 id="to-write-content-to-clipboard"><dfn>write content to the clipboard</dfn></h3>
13031303

13041304
: Input
1305-
:: |items|, a {{DataTransferItemList}} list of items to write
1305+
:: |entries|, a {{DataTransferItemList}} list of entries to write
13061306
:: |clear-was-called|, a boolean
13071307
:: |types-to-clear|, a list
13081308

13091309
: Output
13101310
:: None
13111311

1312-
1. If the |items| list is not empty, then
1312+
1. If the |entries| list is not empty, then
13131313

13141314
1. Clear the clipboard
13151315

@@ -1346,10 +1346,10 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
13461346
<a>setData()</a>'s type argument, sticking to the
13471347
[=mandatory data types=] is strongly recommended.
13481348

1349-
1. Else, the |items| list is empty. Follow these steps to determine
1349+
1. Else, the |entries| list is empty. Follow these steps to determine
13501350
whether to clear the clipboard:
13511351

1352-
1. If the list of items is empty and the |clear-was-called|
1352+
1. If the list of entries is empty and the |clear-was-called|
13531353
flag is <i>true</i>, then
13541354

13551355
1. If the |types-to-clear| list is empty, then
@@ -1508,7 +1508,7 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
15081508
argument is given, add the argument to the
15091509
|types-to-clear| list.
15101510

1511-
1. If a script calls <a>setData()</a> or modifies items and the
1511+
1. If a script calls <a>setData()</a> or modifies entries and the
15121512
|clear-was-called| flag is true, then
15131513

15141514
1. If the |types-to-clear| list is empty, then
@@ -1522,7 +1522,7 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;
15221522
1. Remove it from the list. If the list is now empty,
15231523
set the |clear-was-called| flag to false.
15241524

1525-
1. If a script calls <a>getData()</a> or accesses items in the
1525+
1. If a script calls <a>getData()</a> or accesses entries in the
15261526
{{DataTransferItemList}} and |clipboard-entry| is
15271527
set, then
15281528

0 commit comments

Comments
 (0)