Re: Specifying multiple Optional constraints

On 11/8/13 1:04 PM, Martin Thomson wrote:
> On 8 November 2013 07:31, cowwoc <cowwoc@bbs.darktech.org> wrote:
>> are we only able to specify one optional constraint at a time?
> Yes.  And that doesn't seem like a good idea at all.  Your example of
> resolution demonstrates that it's a problem.

I think the idea is that if height is more import to you, you'd put it 
first:

  {
    mandatory: { width: { max: 1920 }, height: { max: 1080} },

    optional: [ { height: { min: 1080 }, { width: {min: 1920 } } ]
  }

But I agree you still can't combine requirements, and I find the logic 
hard to read to boot.

I proposed an alternative here 
http://lists.w3.org/Archives/Public/public-media-capture/2013Oct/0069.html 
(near bottom).

The whole thing is just an (AND)OR array of alternative requirements:

  [
    { width: 1920, height: 1080 },
    { width: { max: 1920 }, height: { max: 1080 } },
  ]

IMHO simpler (no mandatory/optional), easier to read, easier to 
implement, and more expressive.

.: Jan-Ivar :.

Received on Saturday, 9 November 2013 07:58:59 UTC