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

Re: Extending CSSOM Views matchMedium with callback

From: João Eiras <joaoe@opera.com>
Date: Tue, 11 May 2010 12:29:54 +0200
To: public-webapps@w3.org, www-style@w3.org
Message-ID: <op.vcjd34cl2q99of@id-c0981>
On Tue, 11 May 2010 08:47:27 +0200, Anne van Kesteren <annevk@opera.com>  

> On Mon, 10 May 2010 19:47:42 +0200, João Eiras <joaoe@opera.com> wrote:
>> Should be
>>    addEventListener("mediaChanged", listener, false);
>> There is already an event model, and it would just require a new event  
>> type.
> A generic event is not a good idea in my opinion. The more media  
> features we add the more often it will be dispatched. Authors may not  
> anticipate that. Furthermore, dispatching a bunch of viewport resizing  
> events when the author is only interested in orientation change would be  
> waste.

There was a misunderstanding on my part.

My proposal, using addEventListener, is only for when media mode changes,  
like from screen to print.

The other proposed API calls the listeners when a specific media query  
applies (which can include orientation and device width) and therefore not  
being quite implementable performantly.

I would really like an event just for media change though, so we could  
deprecate onbeforeprint/onafterprint and therefore get a generic event  
that works for any media mode.


João Eiras
Core Developer, Opera Software ASA, http://www.opera.com/
Received on Tuesday, 11 May 2010 10:30:35 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:46 UTC