Re: [cssom-view] comments on StyleMedia interface

On Aug 18, 2010, at 1:29 am, Anne van Kesteren wrote:

> On Wed, 18 Aug 2010 01:03:15 +0200, L. David Baron <dbaron@dbaron.org> wrote:
>> Yes, and also the whole point of the proposal was to avoid having to
>> define when two media queries were equal.
> 
> Ok so we will have
> 
> window.matchMediaQuery(single_query)
> 
> which returns a new object each time it is invoked that implements the following interface
> 
> interface MediaQuery {
>  // canonicalized form of the media query
>  readonly attribute DOMString query;
>  // whether the media query matches currently
>  readonly attribute boolean result;
>  void addListener(MediaQueryChangeListener listener);
>  void removeListener(MediaQueryChangeListener listener);
> };
> 
> If addListener does not guarantee uniqueness removeListener needs to remove from the end of the list. Is that ok?

I don't understand this question. You need to call removeListener() on the same MediaQuery object you called addListener() on. If you call addListener() twice with the same listener on the same MediaQuery, then I don't think it really matters which order they are removed in. 

> 
> styleMedia/StyleMedia will be nuked.

What happens to styleMedia.type?

Simon

Received on Wednesday, 18 August 2010 14:34:52 UTC