You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/07/23 01:52:39 UTC

[jira] [Commented] (CB-4263) The FileReader readyState is not working as expected (value in onload for readAsText)

    [ https://issues.apache.org/jira/browse/CB-4263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14071137#comment-14071137 ] 

ASF subversion and git services commented on CB-4263:
-----------------------------------------------------

Commit 28662835e951f678a045471f9fffe56b6398de62 in cordova-plugin-file's branch refs/heads/master from [~purplecabbage]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file.git;h=2866283 ]

CB-4263 set ready state to done before onload


> The FileReader readyState is not working as expected (value in onload for readAsText)
> -------------------------------------------------------------------------------------
>
>                 Key: CB-4263
>                 URL: https://issues.apache.org/jira/browse/CB-4263
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 2.9.0
>         Environment: Gingerbread emulator
>            Reporter: Peter
>            Assignee: Filip Maj
>            Priority: Minor
>
> _onload_ is called when readAsText was successful, so the readyState should be FileReader.DONE. See http://www.w3.org/TR/FileAPI/#blobreader-state
> But it is still set as FileReader.LOADING.
> Looking at the v2.9.0 cordova.js code you can see that the setting of the readyState for _readAsText_ is inconsistent with all the other read methods.
> i.e.
> {code}
> // If onload callback
> if (typeof me.onload === "function") {
> 	me.onload(new ProgressEvent("load", {target:me}));
> }
> // DONE state
> me._readyState = FileReader.DONE;
> {code}
> It looks like that DONE state should be set *before* the onload invocation.



--
This message was sent by Atlassian JIRA
(v6.2#6252)