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

Specify what getAsString and getAsFile does when DataTransferItem is in the disabled mode #2927

Closed
rniwa opened this issue Aug 16, 2017 · 5 comments
Labels
clarification Standard could be clearer topic: drag and drop

Comments

@rniwa
Copy link
Collaborator

rniwa commented Aug 16, 2017

DataTransferItem defines the disabled mode but the definitions for getAsString(callback) and getAsFile() doesn't check this state. As far as I read the spec, the intent here is for these functions to abort steps but that should be explicitly stated in the spec.

@annevk
Copy link
Member

annevk commented Aug 16, 2017

Isn't that specified by omission? It has to be in one of the two modes listed and otherwise steps get aborted? I agree that it could be clearer though.

@annevk annevk added clarification Standard could be clearer topic: drag and drop labels Aug 16, 2017
@annevk
Copy link
Member

annevk commented Aug 16, 2017

And what I mean by clearer is that we could be more explicit about internal slots (such as mode) and how the value of those slots change over time.

@rniwa
Copy link
Collaborator Author

rniwa commented Aug 16, 2017

No, the current mode of the drag data store is independent of whether a particular instance of DataTransferItem still represents an item in the drag data store or not. e.g. you can be in read/write mode, and an instance of DataTransferItem may refer to an item that had since been removed. e.g. after calling clear on DataTransferItemList.

@annevk
Copy link
Member

annevk commented Aug 16, 2017

The way I read

While the DataTransferItem object's DataTransfer object is associated with a drag data store and that drag data store's drag data store item list still contains the item that the DataTransferItem object represents, the DataTransferItem object's mode is the same as the drag data store mode. When the DataTransferItem object's DataTransfer object is not associated with a drag data store, or if the item that the DataTransferItem object represents has been removed from the relevant drag data store item list, the DataTransferItem object's mode is the disabled mode.

is that the DataTransferItem's mode mirrors drag data store mode until it gets detached somehow. And the steps refer to DataTransferItem's mode, not drag data store mode.

@rniwa
Copy link
Collaborator Author

rniwa commented Aug 16, 2017

Oh, I see. That indeed is sufficient here.

@rniwa rniwa closed this as completed Aug 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer topic: drag and drop
Development

No branches or pull requests

2 participants