Re: MediaQueryList event

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