27 September, 2000

1. Document Object Model Views

Editors
Laurence Cable, Sun
Arnaud Le Hors, W3C

Table of contents

1.1. Introduction

A document may have one or more "views" associated with it, e.g., a computed view on a document after applying a CSS stylesheet, or multiple presentations (e.g., HTML Frame) of the same document in a client. That is, a view is some alternate representation of, or a presentation of, and associated with, a source document.

A view may be static, reflecting the state of the document when the view was created, or dynamic, reflecting changes in the target document as they occur, subsequent to the view being created. This Level of the DOM specification makes no statement about these behaviors.

This section defines an AbstractView interface which provides a base interface from which all such views shall derive. It defines an attribute which references the target document of the AbstractView. The only semantics of the AbstractView defined here create an association between a view and its target document.

There are no subinterfaces of AbstractView defined in the DOM Level 2.

However, AbstractView is defined in and used in this Level in two places:

The interfaces found within this section are not mandatory. A DOM application can use the hasFeature method of the DOMImplementation interface to determine whether they are supported or not. The feature string for all the interfaces listed in this section is "Views" and the version is "2.0".

1.2. Interfaces

Interface AbstractView (introduced in DOM Level 2)

A base interface that all views shall derive from.


IDL Definition
// Introduced in DOM Level 2:
interface AbstractView {
  readonly attribute DocumentView     document;
};

Attributes
document of type DocumentView, readonly
The source DocumentView of which this is an AbstractView.

Interface DocumentView (introduced in DOM Level 2)

The DocumentView interface is implemented by Document objects in DOM implementations supporting DOM Views. It provides an attribute to retrieve the default view of a document.


IDL Definition
// Introduced in DOM Level 2:
interface DocumentView {
  readonly attribute AbstractView     defaultView;
};

Attributes
defaultView of type AbstractView, readonly
The default AbstractView for this Document, or null if none available.