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

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 UTC