Implement BlobEvent

RESOLVED FIXED in mozilla21

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: rlin, Assigned: rlin)

Tracking

({dev-doc-complete})

unspecified
mozilla21
dev-doc-complete
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 5 obsolete attachments)

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;
};
Blocks: 803414
Assignee: nobody → rlin
Created attachment 708419 [details] [diff] [review]
IDL for BlobEvent
Created attachment 708434 [details] [diff] [review]
WIP blobEvent patch
Created attachment 708967 [details] [diff] [review]
WIP2 blobEvent patch

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 5

5 years ago
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 6

5 years ago
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 8

5 years ago
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+

Comment 9

5 years ago
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' ] ?
Created attachment 709565 [details] [diff] [review]
add blobEvent patch1

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+
Created attachment 710006 [details] [diff] [review]
checkin patch

add r=smaug, 
correct align problem.
Created attachment 715038 [details] [diff] [review]
checkin-patch

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/integration/mozilla-inbound/rev/5474b831ece7
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/5474b831ece7
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: checkin-needed
Target Milestone: --- → mozilla21
Keywords: dev-doc-needed
Blocks: 896935

Updated

4 years ago
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
Keywords: dev-doc-needed → dev-doc-complete

Updated

4 years ago
No longer blocks: 896935
You need to log in before you can comment on or make changes to this bug.