Re: [mediacapture-main] Should we use [EnforceRange] on min/max in constraints?

With [extended attributes now applicable to types](https://github.com/heycam/webidl/issues/286) in WebIDL level 2, it seems the following would solve this issue and #385:
* make `ContrainLongRange.min`, `ContrainLongRange.max`, `ContrainLong.ideal`, `ContrainLongRange.exact` of type `[Clamp] unsigned long`
* make the typedef of `ConstrainLong` to be `([Clamp] unsigned long or ConstrainLongRange)`

before a mergeable PR can be made to that effect, [webidl2.js](https://github.com/w3c/webidl2.js/) and ReSpec needs to be updated to support the new construction. (I have already [updated widlproc](https://github.com/dontcallmedom/widlproc/issues/18) which we also use in our CI checks).

The reasons I'm suggesting this compared to what was discussed above:
* I think `[Clamp]` is more friendly since as @jan-ivar points out, it allows to use `Infinity` as a fallback value for `max`
* I think we should use `unsigned` (and thus disallow `-Infinity` for `min`) since the values can only be positive (and thus the default fallback for `min` can be 0)

-- 
GitHub Notification of comment by dontcallmedom
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/384#issuecomment-290671121 using your GitHub account

Received on Friday, 31 March 2017 09:57:03 UTC