Closed
Bug 937348
Opened 11 years ago
Closed 11 years ago
Blob constructor does not accept non-Array blob parts
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: costan, Unassigned)
References
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0 (Beta/Release)
Build ID: 20131030203622
Steps to reproduce:
1. Call the Blob constructor with a sequence object.
Test case: http://jsbin.com/alEMuQu/1
Actual results:
The constructor throws an exception.
Expected results:
The constructor should return a Blob.
http://www.w3.org/TR/FileAPI/#dfn-Blob
Reporter | ||
Comment 1•11 years ago
|
||
This bug was recently fixed in Chrome: http://crbug.com/314755
Comment 2•11 years ago
|
||
Fwiw, there is a proposal right now that this testcase should in fact not work, since this is not an iterable object. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=23683
That said, if nothing else changes it'll start working once Blob is switched to WebIDL bindings.
Depends on: 827823
Reporter | ||
Comment 3•11 years ago
|
||
Thank you!
Please let me know if something changes, and I'll update the Blink and WebKit code to implement what the spec ends up mandating.
Updated•11 years ago
|
Flags: needinfo?(annevk)
Comment 4•11 years ago
|
||
Not sure why I'm needsinfo'd, but yeah, I think the plan still is to only allow iterables.
Flags: needinfo?(annevk)
Comment 5•11 years ago
|
||
You were needinfo'd because this is an example of people in the wild using non-iterables with sequence, which browsers are working on supporting. So if we're going to change how sequence behaves, we better do it asap....
Comment 6•11 years ago
|
||
Victor, consensus seems to be that sequence should take iterables; I will be working on implementing that in Gecko. It would be good to not ship something different in Chrome...
Reporter | ||
Comment 7•11 years ago
|
||
Thank you, Boris!
So, until the meaning of iterable is spec'd, should I remove the support for objects with length+index properties? Is there anything else/better I can do?
Comment 8•11 years ago
|
||
My current plan is to define "iterable" as "an object and GetProperty(obj, @@iterator) returns a callable object", I think. The discussion on exactly how this should work died down. :(
Note that in Gecko DOM nodelists are iterable in this sense, as are arrays and String objects...
Comment 9•11 years ago
|
||
I filed bug 952890 to track implementing sequences as iterables.
Reporter | ||
Comment 10•11 years ago
|
||
Thank you for pointing me to it, Boris! I'll try to find some time soon to investigate matching what you're doing in Blink and WebKit.
Comment 11•11 years ago
|
||
Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
The result in latest Nightly build (20140109030203) is "FAIL! The method parameter is missing or invalid."
Marking New as per above comments and bug 952890.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 12•11 years ago
|
||
The point is, this isn't supposed to work.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•