[w3c/clipboard-apis] Clarify clipboardData's interaction with the Drag Data Store (#50)

Unlike the drag and drop API definitions in the html spec, the descriptions of what the drag data store mode should be for the clipboard data are not well defined here, especially with regard to the state of the clipboard's Drag Data Store and `DataTransfer` objects after the `cut`, `copy`, or `paste` events are complete.

I would imagine that we want to have the same behavior (which prevents all interaction with the clipboard or `DataTransfer` after the event is fired) as is used by Drag and Drop in the spec. 

The following is what I would expect the text to say, given the Drag and Drop spec. It's a little awkward in order to mirror the wording used by the drag and drop specification in the HTML spec.

---

There is a "Drag Data Store" associated with the clipboard. I will call this the "Clipboard Store". By default this store is in `Protected` mode.

When dispatching a `copy` or `cut` event:
* Set the Clipboard Store's mode to `Read/Write` and associate a new `DataTransfer` (`clipboardData`) with it. 
* Fire the event.
* Set the Clipboard Store's mode to `Protected`.
* Disconnect the `DataTransfer` from the store (the `DataTransfer` can no longer affect or read from the Clipboard Store, and appears empty).


When dispatching a `paste` event:
* Set the Clipboard Store's mode to `ReadOnly` and associate a new `DataTransfer` (`clipboardData`) with it. 
* Fire the event.
* Set the Clipboard Store's mode to `Protected`.
* Disconnect the `DataTransfer` from the store (the `DataTransfer` can no longer affect or read from the Clipboard Store, and appears empty).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/50

Received on Tuesday, 5 September 2017 21:27:00 UTC