Closed
Bug 785093
Opened 13 years ago
Closed 13 years ago
Blob constructors are incorrect
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
mozilla15
People
(Reporter: info, Unassigned)
Details
My system:
- Ubuntu 10.04 - 64 bit
- Firefox 14.0.1 ( http://download.mozilla.org/?product=firefox-14.0.1&os=linux&lang=en-US )
The spec for the FileAPI says for the Blob-constructor:
* ArrayBufferView [TypedArrays] array elements
* Blob array elements
* DOMString [WebIDL] array elements
http://www.w3.org/TR/FileAPI/#dfn-blobParts
Due to this, i wrote a simple test (see the console):
http://localhost/test/blob.html
The Result:
Creating a Blob
* from String - works correct
* from Blob - failes with "Illegal value" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"
* from ArrayBufferView (Uint8Array) failes with "An attempt was made to use an object that is not, or is no longer, usable"
* from ArrayBuffer works, but it shouldn't
| Reporter | ||
Comment 1•13 years ago
|
||
Whops, localhost will not work:
Here the sample code:
http://www.dennis-boldt.de/test/blob
| Reporter | ||
Comment 2•13 years ago
|
||
C&P from the example from the spec ( http://www.w3.org/TR/FileAPI/#dfn-blobParts ):
http://www.dennis-boldt.de/test/blob/index2.html
Also not working.
Comment 3•13 years ago
|
||
ArrayBufferView will work in Firefox 15; see bug 752402. This was a recent (after development of Firefox 14 was done) spec change.
I believe the "ArrayBuffer should not work" bit is a spec bug (again, see discussion in bug 752402). Not sure whether that's filed, though.
Code inspection suggests that passing a Blob should work. Could you attach a testcase in which it doesn't? The above localhost link isn't all that usable. ;)
Assignee: general → nobody
Severity: major → normal
Component: JavaScript Engine → DOM
Comment 4•13 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #3)
> I believe the "ArrayBuffer should not work" bit is a spec bug (again, see
> discussion in bug 752402). Not sure whether that's filed, though.
It isn't.
| Reporter | ||
Comment 5•13 years ago
|
||
I forgot the squared brackets in the "from Blob" test case.
It works now. Thanks.
Comment 6•13 years ago
|
||
Thanks for double-checking that!
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
| Assignee | ||
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•