Re: [webauthn] `CredentialRequestOptions` make otherwise valid values invalid in an undesirable way

> I imagine this kind of construction (an optional value with a required subcomponent if it's present) is very common

So far we have two specs trying to do it: webauthn and some proposals for webrtc.  So no, it's not very common.  Maybe because `required` is somewhat new?

> You implied gecko implements "a resolution" and are now indicating that the aforementioned resolution is different than the "elidable stuff" ?

Gecko implements a specific behavior which is one of the proposals under consideration in <https://github.com/heycam/webidl/issues/76>: optional dictionaries always default to null and no other changes from the current WebIDL spec.  Adding the elidable thing is an additional proposal which would affect various dictionary-to-JS conversions, possibly including already-shipping ones.  I haven't checked to see whether there are currently dictionaries returned to JS that include nested dictionaries that would be affected.

> ah! so we can do this:

Sort of.  You can't use `{}` as a default value; see grammar at <https://heycam.github.io/webidl/#prod-DefaultValue>.  But you can use `null`, which will have the same effect.

-- 
GitHub Notification of comment by bzbarsky
Please view or discuss this issue at https://github.com/w3c/webauthn/issues/750#issuecomment-401937032 using your GitHub account

Received on Monday, 2 July 2018 21:09:05 UTC