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

Re: MediaQueryList event

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 9 Jun 2014 10:02:12 -0700
Message-ID: <CAAWBYDAJcnZd9Rea_0y5PhaKT1jFMxn-WpbbJuhr8sqk_tGsxQ@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: "www-style@w3.org" <www-style@w3.org>
On Mon, Jun 9, 2014 at 3:05 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> I don't understand the rationale for making MediaQueryList an event
> target. I understand that there was a mismatch with normal event
> semantics, but it seems like we ought to fix that, not make the entire
> object more complicated.

I don't understand your lack of understanding. ^_^

MQL used callbacks in a trivial way that looked exactly like events,
except they weren't, and because of that there were trivial
incompatibilities with specific details of the event system in
general.  We're just fixing that by switching over to actually using
an event.  Are you suggesting that we should have instead kept MQL
with a custom callback system that instead more carefully aped event
semantics?

This makes MQL an EventTarget, yes, but I don't see that as adding
complication - can you elaborate on your concern?  It is now
technically possible to add a listener in two ways (the legacy
`mql.addListener(cb)` and `mql.addEventListener("change", cb)`), but
that's just us covering the legacy case, and I don't see it as a big
deal.

~TJ
Received on Monday, 9 June 2014 17:02:59 UTC

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