Closed Bug 789691 Opened 12 years ago Closed 12 years ago

BlobPropertyBag doesn't work correctly in Workers.

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: emk, Assigned: emk)

Details

Attachments

(1 file, 1 obsolete file)

Steps to reproduce:
1. Type "new Worker('data:,throw new Blob([],{type:"aaa"}).type');" in Web Console.

Actual result:
An empty string will be thrown. ("uncaught exception: " displayed in Web Console.)

Expected result:
"aaa" should be thrown.

This is basically a legacy dictionary version of bug 788149.
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Attachment #659560 - Flags: review?(bugs)
Comment on attachment 659560 [details] [diff] [review]
Migrate BlobPropertyBag to WebIDL binding dictionary

I should not review any WebIDL usage.
Attachment #659560 - Flags: review?(bugs) → review?(bzbarsky)
Comment on attachment 659560 [details] [diff] [review]
Migrate BlobPropertyBag to WebIDL binding dictionary

I'd prefer just adding "using namespace mozilla::dom" to nsDOMBlobBuilder.cpp, since eventually we'll want all that stuff to live in the mozilla::dom namespace anyway.

I don't understand why the test changes are needed.  Why are they needed?

As far as the actual Blob interface goes, I have two issues:

1)  Spec issue: Why does the contructor take a WebIDL array, not a sequence?  I'll raise a spec issue.

2)  We already have Blob defined as an external interface for now in XMLHttpRequest.webidl.  So the fact that this compiled and worked is a bit of an accident, and arguably a bug in the bindings codegen.  If we just need the Blob to force the dictionary to be generated, could we just use some other dummy interface instead?  Or go ahead and flip our Blob implementations to WebIDL and nix the external interface stuff for Blob?

r=me modulo those issues.
Attachment #659560 - Flags: review?(bzbarsky) → review+
(In reply to Boris Zbarsky (:bz) from comment #3)
> I don't understand why the test changes are needed.  Why are they needed?
I just added a testcase for comment #0 to catch a future regression. The added test will fail without this change.

> 1)  Spec issue: Why does the contructor take a WebIDL array, not a sequence?
> I'll raise a spec issue.
Please, it doesn't matter at the moment because it is commented out right now.

> 2)  We already have Blob defined as an external interface for now in
> XMLHttpRequest.webidl.  So the fact that this compiled and worked is a bit
> of an accident, and arguably a bug in the bindings codegen.  If we just need
> the Blob to force the dictionary to be generated, could we just use some
> other dummy interface instead?  Or go ahead and flip our Blob
> implementations to WebIDL and nix the external interface stuff for Blob?
Blob.webidl only contains a dictionary definition because of the comment out. So the generated file will only contain a definition for the dictionary.
But I'm fine with renaming if you prefer.
> Please, it doesn't matter at the moment because it is commented out right now.

Oh, I missed that.  OK, then that's fine.

> But I'm fine with renaming if you prefer.

No, given that the Blob interface is commented out this is fine.  Good to land!
Added "using namespace mozilla::dom;" per the review comment.
I'll request checkin if the try is green.
https://tbpl.mozilla.org/?tree=Try&rev=2a6180996629
Attachment #659560 - Attachment is obsolete: true
Attachment #659572 - Flags: review+
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/52ad01f2b38e
Flags: in-testsuite+
Keywords: checkin-needed
Target Milestone: --- → mozilla18
https://hg.mozilla.org/mozilla-central/rev/52ad01f2b38e
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: