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

Re-add readAsBinaryString() #44

Merged
merged 1 commit into from
Jul 21, 2016
Merged

Re-add readAsBinaryString() #44

merged 1 commit into from
Jul 21, 2016

Conversation

inexorabletash
Copy link
Member

In spec drafts circa 2011 a readAsBinaryString() method was present, predating Typed Array and readAsArrayBuffer() support. Per #39 this is supported by all major browsers and used in a variety of libraries, so we should accept it as a web-compat necessity and specify it.

@annevk
Copy link
Member

annevk commented Jul 18, 2016

This doesn't seem to actually define/update the read operation?

@inexorabletash
Copy link
Member Author

This doesn't seem to actually define/update the read operation?

https://w3c.github.io/FileAPI/#readOperationSection is used for all of the readXXX() methods. Can you clarify what is missing and/or needs updating?

7. To <a>process read data</a> <a>fire a progress event</a> called {{progress}} at the <a>context object</a>.
8. To <a>process read EOF</a> run these substeps:
1. Set {{FileReader/readyState}} to {{FileReader/DONE}}
2. Set the {{FileReader/result}} attribute to the <a>body</a> returned by the <a>read operation</a> as a <a>binary string</a>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this particularly confusing. Having this be some kind of operation that ends up converting bytes to a string would make it clearer. Currently it seems to invoke a non-normative description of "binary string"...

@inexorabletash
Copy link
Member Author

This CL matches the style for the other methods. I agree they should be improved, but ISTM that should be done separately so they are consistent.

https://w3c.github.io/FileAPI/#dfn-result has:

The list below is normative for the result attribute and is the conformance criteria for this attribute

... and then proceeds to define how the various methods generate result types, which (with this CL) defines binary string. And that section could also be improved, but again this CL just matches the existing style.

@annevk
Copy link
Member

annevk commented Jul 18, 2016

Mkay... The existing style is not great.

@mkruisselbrink
Copy link
Collaborator

Agreed that the way these read operations are defined isn't great, and that it would be nice to have a more explicit definition of "binary string". I filed #45 to reword these things.

@mkruisselbrink mkruisselbrink merged commit 46a28ec into w3c:gh-pages Jul 21, 2016
@inexorabletash inexorabletash deleted the readasbinarystring branch July 21, 2016 22:11
Zirro added a commit to Zirro/jsdom that referenced this pull request Mar 12, 2018
It was re-added to the specification in w3c/FileAPI#44.
domenic pushed a commit to Zirro/jsdom that referenced this pull request Apr 1, 2018
It was re-added to the specification in w3c/FileAPI#44.
domenic pushed a commit to jsdom/jsdom that referenced this pull request Apr 1, 2018
It was re-added to the specification in w3c/FileAPI#44.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants