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

Re: [cssom-view] comments on StyleMedia interface

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 17 Aug 2010 23:56:39 +0200
To: "Simon Fraser" <smfr@me.com>
Cc: www-style@w3.org, "L. David Baron" <dbaron@dbaron.org>
Message-ID: <op.vhlq8p0l64w2qv@anne-van-kesterens-macbook-pro.local>
On Tue, 17 Aug 2010 23:38:51 +0200, Simon Fraser <smfr@me.com> wrote:
> I like David's proposal. It's cleaner (at the expense of adding a new  
> class).

Alright, great. So are we going with the following then:

interface StyleMedia {
   readonly attribute DOMString type;
   MediaQuery matchMedia(query);
};

interface MediaQuery {
   // The serialized form of the query list used to create this object.
   // (Anne: renamed query to media.)
   readonly attribute DOMString media;
   // The current result of the query
   // (Anne: renamed result to matches.)
   readonly attribute boolean matches;
   // add and remove listeners (should it ensure uniqueness or not?)
   void addListener(MediaQueryChangeListener listener);
   void removeListener(MediaQueryChangeListener listener);
};
[Callback=FunctionOnly, NoInterfaceObject]
interface MediaQueryChangeListener {
   void queryChanged(MediaQuery query);
};

?


-- 
Anne van Kesteren
http://annevankesteren.nl/
Received on Tuesday, 17 August 2010 21:57:22 GMT

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