W3C home > Mailing lists > Public > public-media-capture@w3.org > April 2014

Ideal? (was Re: WebIDL-compatible syntax compromise)

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Wed, 02 Apr 2014 12:05:13 -0400
Message-ID: <533C3539.7020108@mozilla.com>
To: Harald Alvestrand <harald@alvestrand.no>, public-media-capture@w3.org
On 4/2/14 11:28 AM, Harald Alvestrand wrote:
> the typical "I must have a size in this range but would really prefer that
> size" example could be expressed as
>
> constraints = {
>     required: "width",
>     width: {min: 230, max: 1024},
>     advanced: [{width: 640}]
> }

This is no worse than in the existing spec, but yes, you probably hit the simplest need for advanced right there, since we can't write:
  
var constraints = {
    required: "width",
    width: {min: 230, max: 1024},
    width: 640, // error: object property repeat!
};

Would people be open to (re)consider the 'ideal' extension?

var constraints = {
    required: "width",
    width: {min: 230, max: 1024, ideal: 640},
};

It might let us get rid of getNativeSettings() as well, as you could get native info in it from getCapabilities().

.: Jan-Ivar :.
Received on Wednesday, 2 April 2014 16:05:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:25 UTC