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

CSSOM View: MediaQueryList - fixed list of listeners

From: Jacob Rossi <jrossi@microsoft.com>
Date: Sat, 2 Apr 2011 00:41:26 +0000
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <D0BC8E77E79D9846B61A2432D1BA4EAE02807A9C@TK5EX14MBXC116.redmond.corp.microsoft.com>
What is the behavior of addListener/removeListener when invoked during the callback of the list of media query list listeners?

For example, consider a MQL that has 3 listeners (A, B, C). The evaluation changes so a dispatch begins.

1.       If B calls addListener(D), then does D get called back for the current dispatch?

2.       If B calls removeListener(C), then does C get called back for the current dispatch?

Given the timing of when the spec currently indicates when to queue tasks, I believe the behavior is that addListener/removeListener have no effect on the current dispatch (they add/remove listeners to the list of listeners, but do not add/remove tasks from the queue to be invoked). This is similar to how addEventListener/removeEventListener behave on the currentTarget during DOM event dispatch.

I agree with this behavior. But it might be good to call this out specifically, perhaps as an example.

--Jacob Rossi [MSFT]
Received on Saturday, 2 April 2011 00:42:02 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:44 UTC