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

Re: why not MediaQueryList.onchange

From: Simon Pieters <simonp@opera.com>
Date: Mon, 19 May 2014 21:45:34 +0900
To: "'Tab Atkins Jr.'" <jackalmage@gmail.com>, "'Jochen Eisinger'" <eisinger@google.com>, François REMY <francois.remy.dev@outlook.com>
Cc: "'www-style list'" <www-style@w3.org>
Message-ID: <op.xf3xp8asidj3kv@simons-macbook-pro.local>
On Mon, 19 May 2014 21:39:00 +0900, François REMY  
<francois.remy.dev@outlook.com> wrote:

> ± > Hey,
> ± >
> ± > I wonder why MediaQueryList defines its own listener interface
> ± > (MediaQueryListListener) instead of just defining an change event on
> ± > the MediaQueryList itself?
> ± >
> ± > The reason I ask is because MediaQueryListListener is a pretty unique
> ± > snowflake in the web exposed APIs which makes it very costly to
> ± > implement and somewhat unintuitive to use.
> ±
> ± The CSSWG resolved today to do what this thread suggests:
> ±
> ± * make MediaQueryList an EventTarget
> ± * fire a non-bubbling "change" event at it whenever things change
> ± * alias the existing addListener(...) to addEventListener("change",  
> ...); same
> ± with removeListener()
>
> Does it include the "mq.onchange" property?

Yes. The wording in the resolution might not include it but we discussed  
it and my understanding is that we're adding .onchange also.

-- 
Simon Pieters
Opera Software
Received on Monday, 19 May 2014 12:46:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:27 UTC