W3C home > Mailing lists > Public > www-style@w3.org > August 2010

Re: [cssom-view] comments on StyleMedia interface

From: Simon Fraser <smfr@me.com>
Date: Wed, 18 Aug 2010 07:34:02 -0700
Cc: "L. David Baron" <dbaron@dbaron.org>, www-style@w3.org
Message-id: <D06570AC-FEBB-487E-946F-AE4437BEFDC4@me.com>
To: Anne van Kesteren <annevk@opera.com>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:30 GMT