W3C home > Mailing lists > Public > www-style@w3.org > June 2013

Re: [cssom] Constructor for MediaList

From: Simon Sapin <simon.sapin@exyr.org>
Date: Wed, 26 Jun 2013 18:24:12 +0100
Message-ID: <51CB23BC.6030600@exyr.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: Simon Pieters <simonp@opera.com>, Glenn Adams <glenn@skynav.com>, "www-style@w3.org" <www-style@w3.org>
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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:12 UTC