W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

Re: DOM Views confusion

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 22 Mar 2006 05:59:45 +0000 (UTC)
To: Cameron McCormack <cam@mcc.id.au>
Cc: public-webapi@w3.org
Message-ID: <Pine.LNX.4.62.0603220556130.8001@dhalsim.dreamhost.com>

On Wed, 22 Mar 2006, Cameron McCormack wrote:
> 
> Ian Hickson:
> > Currently in the DOM there are two ways of getting at views: the 
> > document.defaultView attribute, and the view attribute of UIEvent objects.
> 
> So if the ViewCSS is not the default view, there is actually no way to 
> get to it?

In typical desktop browsers, the defaultView attribute should point to an 
object which is all of the following:

   The ECMAScript global object
   An object implementing Window
   An object implementing AbstractView
   An object implementing ViewCSS


> > I don't know of any UA that actually implements multiple Views.
> 
> I'm trying to fit Window into Batik.  Currently, it has a ViewCSS as its
> default view.

See the WHATWG spec (and the WebAPI Window spec, probably). ViewCSS is one 
of the interfaces implemented by Window.


> It doesn't make sense (wrt Batik's class hierarchy) to have that object 
> also implement Window, so these two views will have to be separate 
> objects.

You'll have to provide "language-specific casting methods" to get from the 
Window object to the ViewCSS object. Conceptually, they're the same.


> Am I correct in surmising, then, that implementing Window and exposing 
> computed styles are mutually exclusive, unless both views are 
> implemented by the same (default) view, and code makes the assumption 
> that it is that default view that implements ViewCSS?

I'm not sure what you mean here.


> It looks to me like DocumentView needs to expose all views of the 
> document somehow.

In practice there is rarely more than one. Opera is the only browser I 
know that actually supports multiple views, and it only has one View (you 
can't get to the computed styles in its aural view; indeed I'm not sure 
it even implements the concept of multiple media correctly).

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 22 March 2006 06:00:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT