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

Re: why not MediaQueryList.onchange

From: Elliott Sprehn <esprehn@gmail.com>
Date: Wed, 9 Apr 2014 17:45:48 -0700
Message-ID: <CAPJYB1ia4pj3AaCZVzQx91L=7JPHej-4JrgG8UpE2SEzK-kf2g@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Please do change this to fire a "change" event. The current semantics
involves a bunch of special logic to deal with copying the handlers and not
notifying new handlers that are added inside dispatch (across all
MediaLists which is far different than events). Gecko has that logic too,
and it's messy.

Lets make addListener/removeListener an alias for
addEventListener/removeEventListener, fire a change event, and stop trying
to reinvent events with all these new APIs. :)

I suspect very little code is using this feature anyway. Blink/WebKit fire
them in totally different orders and at different times than Gecko.

On Mon, Mar 31, 2014 at 4:18 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 3/31/14 5:07 PM, Tab Atkins Jr. wrote:
>> Yeah, we should fire a "change" event or something on it, and define
>> addListener(...) as just calling addEventListener("change", ...)
> That changes the sematics of calling addListener(f) twice in a row with
> the same function.  Are we sure there's no code depending on the current
> semantics?
> -Boris
Received on Thursday, 10 April 2014 00:46:54 UTC

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