Bug 158536

Summary: WebRTC: The RTCTrackEventInit dictionary needs required members
Product: WebKit Reporter: Adam Bergkvist <adam.bergkvist>
Component: WebCore Misc.Assignee: Nael Ouedraogo <nael.ouedp>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, commit-queue, nael.ouedp, rniwa, youennf
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 143211    
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews101 for mac-yosemite
none
Patch none

Description Adam Bergkvist 2016-06-08 12:20:05 PDT
An attribute marked with [InitializedByEventConstructor] seem to be nullable and non-required [1] by default. RTCTrackEventInit [2] needs non-nullable and required dictionary members.

[1] http://heycam.github.io/webidl/#required-dictionary-member
[2] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#idl-def-rtctrackeventinit
Comment 1 Nael Ouedraogo 2016-10-20 09:50:20 PDT
(In reply to comment #0)
> An attribute marked with [InitializedByEventConstructor] seem to be nullable
> and non-required [1] by default. 

It is fixed now so we can update RTCTrackEvent IDL.
Comment 2 Chris Dumez 2016-10-20 09:51:05 PDT
[InitializedByEventConstructor] is no longer supported. You should use a dictionary, as in the specification. Also, as far as I know, we support required dictionary members already.

Marking as Invalid, feel free to reopen if you find issues remain.
Comment 3 Nael Ouedraogo 2016-10-20 09:59:29 PDT
(In reply to comment #2)
> [InitializedByEventConstructor] is no longer supported. You should use a
> dictionary, as in the specification. Also, as far as I know, we support
> required dictionary members already.
> 
> Marking as Invalid, feel free to reopen if you find issues remain.
Ok, I modified the bug title to update RTCTrackEvent IDL as described in comment #0. Is it better to file a new bug?
Comment 4 Chris Dumez 2016-10-20 10:03:09 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > [InitializedByEventConstructor] is no longer supported. You should use a
> > dictionary, as in the specification. Also, as far as I know, we support
> > required dictionary members already.
> > 
> > Marking as Invalid, feel free to reopen if you find issues remain.
> Ok, I modified the bug title to update RTCTrackEvent IDL as described in
> comment #0. Is it better to file a new bug?

I do not mind either way.
Comment 5 Nael Ouedraogo 2016-10-20 10:07:59 PDT
Reopened to update RTCTrackEvent IDL.
Comment 6 Nael Ouedraogo 2016-10-20 10:11:01 PDT
Created attachment 292218 [details]
Patch
Comment 7 Build Bot 2016-10-20 11:08:15 PDT
Comment on attachment 292218 [details]
Patch

Attachment 292218 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/2332277

New failing tests:
compositing/iframes/page-cache-layer-tree.html
Comment 8 Build Bot 2016-10-20 11:08:19 PDT
Created attachment 292225 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 9 Nael Ouedraogo 2016-10-21 02:46:27 PDT
(In reply to comment #8)
> Created attachment 292225 [details]
> Archive of layout-test-results from ews101 for mac-yosemite
> 
> The attached test failures were seen while running run-webkit-tests on the
> mac-ews.
> Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5

Failure observed in compositing/iframes/page-cache-layer-tree.html seems not related to the patch. 
Same test on mac-elcapitan successfully passed locally.
Comment 10 Chris Dumez 2016-10-21 09:01:46 PDT
Comment on attachment 292218 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=292218&action=review

r=me with comments

> Source/WebCore/Modules/mediastream/RTCTrackEvent.idl:37
> +    readonly attribute sequence<MediaStream> streams;

Looks like this should be a FrozenArray while you're at it (We support it).

> LayoutTests/fast/mediastream/RTCTrackEvent-constructor.html:55
>                  shouldThrow("new RTCTrackEvent('eventType', { receiver: null, track: track, transceiver: transceiver})");

Could you please update the test so that it only passes if we throw a TypeError (and not other exception types).
e.g.

shouldThrowErrorName("new RTCTrackEvent('eventType', { receiver: null, track: track, transceiver: transceiver})", "TypeError");
Comment 11 Adam Bergkvist 2016-10-24 00:28:13 PDT
(In reply to comment #10)
> > Source/WebCore/Modules/mediastream/RTCTrackEvent.idl:37
> > +    readonly attribute sequence<MediaStream> streams;
> 
> Looks like this should be a FrozenArray while you're at it (We support it).

Great. That would match the spec.

https://w3c.github.io/webrtc-pc/archives/20160913/webrtc.html#rtctrackevent
Comment 12 Chris Dumez 2016-10-24 07:37:05 PDT
(In reply to comment #11)
> (In reply to comment #10)
> > > Source/WebCore/Modules/mediastream/RTCTrackEvent.idl:37
> > > +    readonly attribute sequence<MediaStream> streams;
> > 
> > Looks like this should be a FrozenArray while you're at it (We support it).
> 
> Great. That would match the spec.
> 
> https://w3c.github.io/webrtc-pc/archives/20160913/webrtc.html#rtctrackevent

This is why I suggested it :)
Comment 13 Nael Ouedraogo 2016-10-26 03:10:21 PDT
Created attachment 292912 [details]
Patch
Comment 14 Nael Ouedraogo 2016-10-26 03:13:47 PDT
> > Source/WebCore/Modules/mediastream/RTCTrackEvent.idl:37
> > +    readonly attribute sequence<MediaStream> streams;
> 
> Looks like this should be a FrozenArray while you're at it (We support it).
Ok done in uploaded patch, I was not sure that it was supported.

> > LayoutTests/fast/mediastream/RTCTrackEvent-constructor.html:55
> >                  shouldThrow("new RTCTrackEvent('eventType', { receiver: null, track: track, transceiver: transceiver})");
> 
> Could you please update the test so that it only passes if we throw a
> TypeError (and not other exception types).
> e.g.
> 
> shouldThrowErrorName("new RTCTrackEvent('eventType', { receiver: null,
> track: track, transceiver: transceiver})", "TypeError");
Done in uploaded patch.

Thanks for the review.
Comment 15 WebKit Commit Bot 2016-10-26 05:57:37 PDT
Comment on attachment 292912 [details]
Patch

Clearing flags on attachment: 292912

Committed r207895: <http://trac.webkit.org/changeset/207895>
Comment 16 WebKit Commit Bot 2016-10-26 05:57:42 PDT
All reviewed patches have been landed.  Closing bug.