Closed Bug 834165 Opened 11 years ago Closed 11 years ago

Implement BlobEvent

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: rlin, Assigned: rlin)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 5 obsolete files)

MediaRecorder api require this to transfer the encoder/image data to jscontext.

idl:
BlobEvent interface

[Constructor(DOMString type, optional BlobEventInit blobInitDict)]
interface BlobEvent : Event {
    readonly attribute Blob data;
};

dictionary BlobEventInit : EventInit {
    Blob data;
};
Assignee: nobody → rlin
Attached patch IDL for BlobEvent (obsolete) — Splinter Review
Attached patch WIP2 blobEvent patch (obsolete) — Splinter Review
Hi Olli, 
We want to add the BlobEvent for MediaRecorder server side event and let jsContext can get the encode data, Can you help to review it?
Thanks a lot.
Attachment #708434 - Attachment is obsolete: true
Attachment #708967 - Flags: feedback?(bugs)
Comment on attachment 708967 [details] [diff] [review]
WIP2 blobEvent patch

Review of attachment 708967 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/interfaces/events/nsIDOMBlobEvent.idl
@@ +17,5 @@
> +  /**
> +   * Custom blob data associated with this event.
> +   */
> +  readonly attribute nsIDOMBlob data;
> +  void initBlobEvent(in DOMString aType,

This should be [noscript].
Comment on attachment 708419 [details] [diff] [review]
IDL for BlobEvent

I don't know what is MediaRecorder. Is it from some specification?
And if so, does the spec really have BlobEvent, since that is quite odd name.
It feels too generic.
Comment on attachment 708419 [details] [diff] [review]
IDL for BlobEvent

Er, missed the URL :)
Hi OLLi, 
Here is the draft url for reference. 
https://dvcs.w3.org/hg/dap/raw-file/tip/media-stream-capture/RecordingProposal.html
BTW, this is just the draft version.
Comment on attachment 708967 [details] [diff] [review]
WIP2 blobEvent patch

iniBlobEvent should be [noscript]

nsDOMFile.h should be nsIDOMFile.h, right?
You shouldn't need to add anything to dictionary_helper_gen.conf
event_impl_gen.conf.in should take care of the dictionary automatically.
Attachment #708967 - Flags: feedback?(bugs) → feedback+
And forget comment 5. The event is coming from a "spec".
Hi Olli, 
I try to remove the dictionary_helper_gen.conf but found this would cause build break on DictinaryHelper.cpp, show can't find nsIDOMBlob.h....
change to [noscript], the js can't access the data attribute. Did i miss something?
[noscript] for initBlobEvent only.

could you just add nsIDOMFile.h to the special include and exclude nsIDOMBlob.h in the 
dictionary_helper_gen.conf.in but not add [ 'BlobEventInit', 'nsIDOMBlobEvent.idl' ] ?
Attached patch add blobEvent patch1 (obsolete) — Splinter Review
Hi Olli, 
Please help to review that, 
try server result:
https://tbpl.mozilla.org/?tree=Try&rev=5449988b57d6
Attachment #709565 - Flags: review?(bugs)
Component: General → DOM
Product: Firefox → Core
Comment on attachment 709565 [details] [diff] [review]
add blobEvent patch1


> 	nsIDOMCustomEvent.idl			\
> 	nsIDOMCompositionEvent.idl		\
> 	nsIDOMWheelEvent.idl			\
>+	nsIDOMBlobEvent.idl				\
Align \ properly


>+[scriptable, builtinclass, uuid(84293ee0-68f5-11e2-9906-cf63ba8c6e43)]
>+interface nsIDOMBlobEvent : nsIDOMEvent
>+{
>+  /**
>+   * Custom blob data associated with this event.
>+   */
>+  readonly attribute nsIDOMBlob data;
>+  [noscript]
>+  void initBlobEvent(in DOMString aType,
>+                        in boolean aCanBubble,
>+                        in boolean aCancelable,
>+                        in nsIDOMBlob aData);
align parameters and perhaps a newline before [noscript]
Attachment #709565 - Flags: review?(bugs) → review+
Attached patch checkin patch (obsolete) — Splinter Review
add r=smaug, 
correct align problem.
Attached patch checkin-patchSplinter Review
fix conflict
Attachment #710006 - Attachment is obsolete: true
Whiteboard: checkin-needed
Attachment #708419 - Attachment is obsolete: true
Attachment #708967 - Attachment is obsolete: true
Attachment #709565 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/5474b831ece7
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: checkin-needed
Target Milestone: --- → mozilla21
No longer blocks: 803414
I noted that our implementation differs from the spec: the Blob itself is optional, it can be null, whereas the spec has it mandatory.

Beside this, documentation written:
https://developer.mozilla.org/en-US/docs/Web/API/BlobEvent
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/22
No longer blocks: MediaRecording
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: