Re: why not MediaQueryList.onchange

On Mon, Mar 31, 2014 at 11:28 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Mon, Mar 31, 2014 at 2:25 PM, Jochen Eisinger <eisinger@google.com>
> wrote:
> > On Mon, Mar 31, 2014 at 11:17 PM, Boris Zbarsky <bzbarsky@mit.edu>
> wrote:
> >> On 3/31/14 4:51 PM, Jochen Eisinger wrote:
> >>> The reason I ask is because MediaQueryListListener is a pretty unique
> >>> snowflake in the web exposed APIs
> >>
> >> It is?  It's just a WebIDL callback function.  There are tons of them in
> >> the platform: event handlers, audio API callbacks, geolocation
> callbacks,
> >> mutation observer callbacks, WebRTC callbacks of various sorts, Web
> >> Components callbacks, requestAnimationFrame, probably more that I'm
> missing.
> >> What's the unique aspect of MediaQueryListListener?
> >
> > The other callbacks don't have a property that gets invoked, it's e.g.
> > setTimeout(function() { ..}, 42) and not setTimeout({timeout: function()
> {
> > ...}}, 42);
>
> Hm?  You just pass a callback function to MQList.addListener().
>

No, you have to pass an object that implements MediaQueryListListener, i.e.
that has a method handleChange().


>
> ~TJ
>

Received on Monday, 31 March 2014 21:33:00 UTC