Re: No-change proposals for WebIDL for constraints

On 2013-12-16 18:44, Harald Alvestrand wrote:
> I think we're landing on the basic structure of constraints as retaining
> the properties it has:
>
> - Mandatory is a set of key/value pairs, where all of them need to be
> satisfied in order for the allocation to succeed. If the browser does
> not understand a key, it does not succeed. (I know Jan-Ivar doesn't agree.)

+1

>
> - Optional is a sequence of sets of key/value pairs. (I'm suggesting
> that we relax the rule of only one key/value pair for each element in
> the sequence). The browser will try to satisfy as many constraint sets
> as it can, but will ignore constraint sets that cannot be satisified,
> these will not cause the call to fail.
>
> The Mandatory set of key/value pairs doesn't have the same semantics as
> Dictionary. Therefore it is not a Dictionary.
>
> Existing deployed code is expecting this code to be correctly parsed:
>
> getUserMedia(.... { mandatory: { a=b}, optional: [ {c=d} ]})
>
> It would be nice to keep that representation parsing.
>
> The following suggestions are all valid IDL for the Constraints
> construct in section 10.1.4.4 of the current getusermedia spec (which is
> currently incomplete):
>
> dictionary Constraints {
>     ConstraintSet? mandatory;
>     sequence<ConstraintSet> _optional;
> };
>
> Alternative 1:
>
> ConstraintSet = object. This will Just Work, with the usual caveats
> about generated code needing to deal with Object.

I think we should be pragmatic and choose Alternative 1 and move on.



Received on Wednesday, 18 December 2013 10:47:02 UTC