Re: window definition

Rafael Arantes:
> OK, but I think there is a mistake in this interfaces (AbstractView
> and/or DocumentView), or in the interface Document, because neither
> Document has a DocumentView attribute nor DocumentView has a Document
> attribute. There is any method (or default sequence of steps) to
> access one by another, or it's only an implementation specific
> decision that depends of other attributes defined in the
> implementation?

The AbstractView/DocumentView stuff comes from DOM Level 2 Views:

  http://www.w3.org/TR/DOM-Level-2-Views/

Document objects implement DocumentView.  The Window interface,
according to HTML 5, is implemented on the object that represents the
default view (i.e., the AbstractView that is returned from
DocumentView::defaultView).

So that means document.defaultView is the Window object, and
window.document (via the AbstractView::document attribute) is the
Document.

Whether that’s a sane organisation for Documents and Windows is another
question. :-)


Note also that the Window interface is specified in

  http://dev.w3.org/2006/webapi/Window/

but that spec has languished in favour of the Window definition in
HTML 5.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Thursday, 7 May 2009 00:19:59 UTC