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

Change the ClipboardItem constructor to take ClipboardItemData. #126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lgarron
Copy link
Contributor

@lgarron lgarron commented Jun 25, 2020

Closes #????

The following tasks have been completed:

  • Modified Web platform tests (link to pull request)

Implementation commitment:

Right now:

  • ClipboardItemDataType is a string or a Blob;
  • ClipboardItemData is a Promise of a ClipboardItemDataType.

There are definitely some compatibility issues in the wild. In particular, Chrome only accepts Blobs, and throws an exception if you pass in a string or a Promise. Is it possible that the constructor is supposed to take ClipboardItemDataType values? If not, should it accept any values that are either ClipboardItemData or ClipboardItemDataType?

FYI: my W3C affiliation is set to GitHub, Inc., but this my participation in this repo should be considered under my Chromium affiliation.


Preview | Diff

lgarron added a commit to lgarron/clipboard-apis that referenced this pull request Jun 25, 2020
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 (w3c#126).
lgarron added a commit to lgarron/clipboard-apis that referenced this pull request Jun 25, 2020
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 (w3c#126).
@lgarron
Copy link
Contributor Author

lgarron commented Jun 25, 2020

FYI: my W3C affiliation is set to GitHub, Inc., but this my participation in this repo should be considered under my Chromium affiliation. I don't know if there's a way to tell the CI this.

@lgarron lgarron changed the title Change the ClipboardItem constructor to ClipboardItemData. Change the ClipboardItem constructor to take ClipboardItemData. Jun 25, 2020
@siusin
Copy link
Contributor

siusin commented Jun 30, 2020

Hi @lgarron. Thanks for these pull requests, we really appreciate your contribution to the Clipboard API.

Re the IRP issue, it'd be difficult for W3C to use Chromium as a sponsor for pull requests, since Chromium hasn't (and probably can't) make IPR commitments.

We are wondering, as a GitHub employee (and thus a Microsoft employee), if your contribution could be covered by Microsoft participation to the WebApps WG?

cc @travisleithead @dontcallmedom

@lgarron
Copy link
Contributor Author

lgarron commented Jul 6, 2020

We are wondering, as a GitHub employee (and thus a Microsoft employee), if your contribution could be covered by Microsoft participation to the WebApps WG?

Hmm, I'm not contributing this on behalf of GitHub/Microsoft, though. (GitHub has a pretty generous moonlighting clause.)
Could I contribute as an individual?

@wseltzer
Copy link
Member

wseltzer commented Jul 6, 2020

Hi @lgarron, the key question for IPR commitment purposes is who has rights to the IP in this contribution? For example, if your employer lets employees keep the rights to work done in their own time, and that were the case for work you contributed here, then unless you made another agreement assigning rights, say to chromium, you would be able to make an individual IPR commitment here, and @siusin can send you the link.

Feel free to get in touch with me if you have questions. ([email protected]) Thanks!

@travisleithead
Copy link
Member

@lgarron I'm looking into this right now. Feel free to ping-me offline for questions in the meantime...

@travisleithead
Copy link
Member

@wseltzer, @siusin, to close the loop on this:

Microsoft has no concerns with @lgarron's individual contribution here--it is approved for him to make this contribution as an individual. @siusin please send @lgarron the relevant link to do so.

@lgarron if you plan on making more regular contributions to this group, please let me know, and I'll get you connected with the folks that help coordinate our activities here, we can get you added under Microsoft's contribution agreement. That will remove these speed bumps from your future contributions. ;)

@siusin
Copy link
Contributor

siusin commented Jul 17, 2020

Thanks all!

@lgarron we can consider #126 as a non-normative contribution but please at least sign the Non-Participant Licensing Commitment for #127 via
https://www.w3.org/2004/01/pp-impl/nplc/33993598/127/edit?contributors[]=lgarron&groups[]=114929

@marcoscaceres
Copy link
Member

Blocking on template actions. Editors, could you please make sure bugs are filed on the user agents and that there are corresponding tests. It seems @lgarron has identified some additional compat bugs, so would be great to have tests to help resolve those across UAs.

Base automatically changed from master to main February 3, 2021 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants