Re: why not MediaQueryList.onchange

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);


>
>
>  which makes it very costly to implement
>>
>
> I assume you mean in Blink?  In Gecko it's one single line of IDL to
> implement it.


Well, and WebKit. In both cases, it's a single line of IDL, but the C++
part that stores the listeners and invokes them is huge. If it was an
event, the C++ part would get auto generated.

best
-jochen


>
>
> -Boris
>
>
>
>

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