Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fields in RTCStats dictionary should be required #1476

Closed
soareschen opened this issue Jul 13, 2017 · 7 comments
Closed

Fields in RTCStats dictionary should be required #1476

soareschen opened this issue Jul 13, 2017 · 7 comments

Comments

@soareschen
Copy link
Contributor

The current definition for RTCStats dictionary seems to allow timestamp and id to be optional. For the type field it is only in the description that require it to be initialized. Should all 3 fields be declared as required in the WebIDL definition?

@taylor-b
Copy link
Contributor

I can't find any other normative requirement that forces them to be present, so marking them as required seems sensible.

@aboba
Copy link
Contributor

aboba commented Jul 14, 2017

Typically required is used for dictionaries used as inputs, not outputs.

@soareschen
Copy link
Contributor Author

Not sure how WebIDL intends dictionaries to be used as return values, but in this spec the RTCSessionDescriptionInit dictionary returned from createOffer/createAnswer also has a required field type.

@taylor-b
Copy link
Contributor

It can be used to construct an RTCSessionDescription (which is possible for backwards compatibility) so that's possibly why.

Anyway, the point I was trying to make above is that if we don't have any normative requirement that says "timestamp MUST be present in returned RTCStats objects", then making it required is a way to implicitly add that requirement, and make it easy to find. Though maybe this is frowned upon and we should ask a WebIDL expert for advice.

@aboba
Copy link
Contributor

aboba commented Jul 14, 2017

@jan-ivar Do you have an opinion?

@jan-ivar
Copy link
Member

I do, but I've asked for clarification first in whatwg/webidl#382.

@jan-ivar
Copy link
Member

To follow up, my thoughts here are in #1493 (comment). In short, I agree with whatwg/webidl#382 (comment) there's an implicit normative requirement that implementations must fill in this member.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants