Re: No-change proposals for WebIDL for constraints

On 16/12/2013 6:11 PM, Harald Alvestrand wrote:
> On 12/16/2013 08:13 PM, cowwoc wrote:
>> On 16/12/2013 1:31 PM, Martin Thomson wrote:
>>> On 16 December 2013 10:05, cowwoc <cowwoc@bbs.darktech.org> wrote:
>>>>    [ {"width": 1920, "height": 720} ],
>>>>    [ {"width": 1600, "height": 900} ],
>>> I hope that those brackets are just a mistake.
>> Yes, they are.
>>
>> I just meant that we should be able to specify multiple constraints 
>> per line, instead of one (as is currently the case).
> Lines have no significance in Javascript (well.... rarely; another 
> strange feature of the language), but the difference between [] and {} 
> is significant, and it is important to use the right one.
>
> Your examples are showing an array each of whose elements contains an 
> array, each of which has an object with 2 key-value pairs. That's a 
> novel structure that I don't see a reason for.

As discussed in a follow-up post, this was a lapse on my part. I agree 
there is no need for the double array.

> I suggested in the original note that
>
> { optional:
> [
>   {"width": 1920, "height": 720},
>   {"width": 1600, "height": 900},
> ] }
>
> which is an array of 2 elements, each containing 2 key-value pairs, 
> should be a legal constraint value.

I couldn't find the original note that you referred to, but in any case 
I agree with this syntax. +1

Gili

Received on Monday, 16 December 2013 23:32:35 UTC