cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Grieve (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-4263) The FileReader readyState is not working as expected (value in onload for readAsText)
Date Mon, 24 Feb 2014 21:15:21 GMT

     [ https://issues.apache.org/jira/browse/CB-4263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrew Grieve updated CB-4263:
------------------------------

    Component/s:     (was: CordovaJS)

> 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.1.5#6160)

Mime
View raw message