Re: [cssom] Constructor for MediaList

Le 26/06/2013 18:18, Tab Atkins Jr. a écrit :
>> Why is a constructor needed instead of just a string?
>>
>> document.css.customMedia.set("foo", "(foo:bar) and (baz:qux)");
> Because a custom MQ should be settable to a string as well, so you can
> do ("foo": "bar"), similar to existing MQs that let you test for
> specific values.
>
> Basically, custom MQs should be settable to booleans, strings, or
> numbers.  Setting them to another MQ is a special form of
> auto-updating boolean.

I meant a JS string, not a CSS string.

Your proposal is to have the JS API allow setting custom MQs to 
booleans, numbers, and MQ objects. The latter are auto-updating booleans.

My proposal is to allow booleans, numbers, and strings. The latter are 
parsed as MQs for auto-updating booleans.

-- 
Simon Sapin

Received on Wednesday, 26 June 2013 17:24:40 UTC