[FileAPI] FileReader should throw an InvalidStateError exception when readyState...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2012 09:42:57 +0000 (09:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2012 09:42:57 +0000 (09:42 +0000)
commite782cca16ca2b06e5eec9bba5d6004cb10bb56a7
tree3407a01a39a8735ee32d2e84dd014eafc6d569c8
parent73933015d66a00e93a057cbb8468e3a86a1dae1d
[FileAPI] FileReader should throw an InvalidStateError exception when readyState is LOADING
https://bugs.webkit.org/show_bug.cgi?id=88212

Patch by Li Yin <li.yin@intel.com> on 2012-06-07
Reviewed by Jian Li.

Source/WebCore:

From Spec: http://www.w3.org/TR/FileAPI/#readAsBinaryString
FileReader should throw an InvalidStateError exception instead of NOT_ALLOWED_ERR
when the readyState is LOADING.
Also delete OperationNotAllowedException related code, because it is not longer needed.

Tests: fast/files/read-file-async.html
       fast/files/workers/worker-read-file-async.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMExceptions.in:
* fileapi/FileReader.cpp:
(WebCore::FileReader::readInternal): Changed it to throw INVALID_STATE_ERR.
* fileapi/FileReader.idl: Changed it to raise DOMException for all read methods.
* fileapi/OperationNotAllowedException.cpp: Removed.
* fileapi/OperationNotAllowedException.h: Removed.
* fileapi/OperationNotAllowedException.idl: Removed.

LayoutTests:

From spec: http://www.w3.org/TR/FileAPI/#readAsBinaryString
FileReader should throw an InvalidStateError exception instead of NOT_ALLOWED_ERR.

* fast/files/read-file-async-expected.txt:
* fast/files/workers/worker-read-file-async-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/files/read-file-async-expected.txt
LayoutTests/fast/files/workers/worker-read-file-async-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/DerivedSources.pri
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/DOMExceptions.in
Source/WebCore/fileapi/FileReader.cpp
Source/WebCore/fileapi/FileReader.idl
Source/WebCore/fileapi/OperationNotAllowedException.cpp [deleted file]
Source/WebCore/fileapi/OperationNotAllowedException.h [deleted file]
Source/WebCore/fileapi/OperationNotAllowedException.idl [deleted file]