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

Re: why not MediaQueryList.onchange

From: Jonathan Fielding <hello@jonathanfielding.com>
Date: Mon, 09 Jun 2014 20:22:54 +0000
Cc: Jochen Eisinger <eisinger@google.com>, www-style list <www-style@w3.org>
Message-Id: <63F5D3EA-F0E7-4C65-860A-FEDAE5B5F665@gmail.com> (sfid-20140609_202302_582815_11A6D2AA)
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Would be nice to be able to do addEventListener(“resize”, …) as well, I have mentioned this in previous threads because its really important to some responsive sites



On 19 May 2014, at 13:13, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Tue, Apr 1, 2014 at 5:51 AM, Jochen Eisinger <eisinger@google.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()
> 
> ~TJ
> 
Received on Wednesday, 23 July 2014 14:22:15 UTC

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