W3C home > Mailing lists > Public > www-style@w3.org > April 2010

Re: Extending CSSOM Views matchMedium with callback Re: CSS WG comments on View Modes Media Feature spec

From: Robin Berjon <robin@berjon.com>
Date: Thu, 15 Apr 2010 13:39:58 +0200
Cc: Kenneth Christiansen <kenneth.christiansen@openbossa.org>, Simon Fraser <smfr@me.com>, Daniel Glazman <daniel.glazman@disruptive-innovations.com>, "public-webapps@w3.org" <public-webapps@w3.org>, "www-style@w3.org" <www-style@w3.org>, Anne van Kesteren <annevk@opera.com>, Arthur Barstow <art.barstow@nokia.com>
Message-Id: <2671D90A-C02C-4199-8420-5BA233178F30@berjon.com>
To: Marcos Caceres <marcosc@opera.com>
On Apr 15, 2010, at 10:47 , Marcos Caceres wrote:
> On Apr 14, 2010, at 10:18 PM, Kenneth Christiansen <kenneth.christiansen@openbossa.org> wrote:
>> Oi Marcos,
>> 
>>> # 3.2. Media Type Changed Event Types
>>> styleMedia.matchMedium("screen", function() { alert("no longer screen!") })
>> 
>> So you want it to call back when the match is no longer true? or did
>> you mean "not screen" ?
> 
> Could be either, I guess.

How about:

  boolean matchMedium (DOMString mediaQ, optional Function trueCB, optional Function falseCB);

Which would lead to:

  styleMedia.matchMedium("screen",
                         function () { alert("Now screen!"); },
                         function () { alert("No longer screen!"); });

?

-- 
Robin Berjon - http://berjon.com/
Received on Thursday, 15 April 2010 11:40:29 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:26 GMT