<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
 Generated: Thu Nov 09 17:43:41 EST 2000 jfouffa.w3.org
 -->
<html lang='en' xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Document Object Model Views</title>
<link rel='stylesheet' type='text/css' href='./spec.css' />
<link rel='stylesheet' type='text/css' href='W3C-REC.css' />
<link rel='next' href='idl-definitions.html' />
<link rel='contents' href='Overview.html#contents' />
<link rel='index' href='def-index.html' />
<link rel='previous' href='copyright-notice.html' />
</head>
<body>
<div class='navbar' align='center'><a accesskey='p'
href='copyright-notice.html'>previous</a> &nbsp; <a accesskey='n'
href='idl-definitions.html'>next</a> &nbsp; <a accesskey='c'
href='Overview.html#contents'>contents</a> &nbsp; <a accesskey='i'
href='def-index.html'>index</a> 

<hr title='Navigation area separator' />
</div>

<div class='noprint' style='text-align: right'>
<p style='font-family: monospace;font-size:small'>13 November,
2000</p>
</div>

<div class='div1'><a id="Views" name='Views'></a> 

<h1 id='Views-h1' class='div1'>1. Document Object Model Views</h1>

<dl>
<dt><i>Editors</i></dt>

<dd>Arnaud Le Hors, IBM</dd>

<dd>Laurence Cable, Sun Microsystems</dd>
</dl>

<div class='noprint'>
<h2 id='table-of-contents'>Table of contents</h2>

<ul class='toc'>
<li class='tocline3'><a class='tocxref' href='#Views-intro'>1.1.
Introduction</a></li>

<li class='tocline3'><a class='tocxref'
href='#Views-Interfaces'>1.2. Interfaces</a> 

<ul class='toc'>
<li class='tocline4'><a
href='#Views-AbstractView'>AbstractView</a>, <a
href='#Views-DocumentView'>DocumentView</a></li>
</ul>
</li>
</ul>
</div>

<div class='div2'><a id="Views-intro" name='Views-intro'></a> 

<h2 id='Views-intro-h2' class='div2'>1.1. Introduction</h2>

<p>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.</p>

<p>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.</p>

<p>This section defines an <a
href='views.html#Views-AbstractView'><code>AbstractView</code></a>
interface which provides a base interface from which all such views
shall derive. It defines an attribute which references the target
document of the <a class='noxref'
href='views.html#Views-AbstractView'><code>AbstractView</code></a>.
The only semantics of the <a class='noxref'
href='views.html#Views-AbstractView'><code>AbstractView</code></a>
defined here create an association between a view and its target
document.</p>

<p>There are no subinterfaces of <a
href='views.html#Views-AbstractView'><code>AbstractView</code></a>
defined in the DOM Level 2.</p>

<p>However, <a
href='views.html#Views-AbstractView'><code>AbstractView</code></a>
is defined in and used in this Level in two places:</p>

<ul>
<li>A Document may implement a <a
href='views.html#Views-DocumentView'><code>DocumentView</code></a>
that has a default view attribute associated with it. This default
view is typically dependent on the implementation (e.g., the
browser frame rendering the document). The default view can be used
in order to identify and/or associate a view with its target
document (by testing object equality on the <a
href='views.html#Views-AbstractView'><code>AbstractView</code></a>
or obtaining the <a class='noxref'
href='views.html#Views-DocumentView'><code>DocumentView</code></a>
attribute).</li>

<li>A <code>UIEvent</code> typically occurs upon a view of a
Document (e.g., a mouse click on a browser frame rendering a
particular Document instance). A <code>UIEvent</code> has an <a
href='views.html#Views-AbstractView'><code>AbstractView</code></a>
associated with it which identifies both the particular
(implementation-dependent) view in which the event occurs, and the
target document the <code>UIEvent</code> is related to.</li>
</ul>

<p>The interfaces found within this section are not mandatory. A
DOM application may use the <code>hasFeature(feature,
version)</code> method of the <code>DOMImplementation</code>
interface with parameter values "Views" and "2.0" (respectively) to
determine whether or not this module is supported by the
implementation. In order to fully support this module, an
implementation must also support the "Core" feature defined defined
in the Document Object Model Level 2 Core specification [<a
class='noxref' href='references.html#DOMCore'>DOM Level 2
Core</a>]. Please refer to additional information about <a
href='http://www.w3.org/TR/DOM-Level-2-Core/introduction.html#ID-Conformance'>
<em>conformance in the DOM Level 2 Core specification</em></a>.</p>
</div>

<!-- div2 Views-intro -->
<div class='div2'><a id="Views-Interfaces"
name='Views-Interfaces'></a> 

<h2 id='Views-Interfaces-h2' class='div2'>1.2. Interfaces</h2>

<dl>
<dt><b>Interface <i><a id="Views-AbstractView"
name='Views-AbstractView'>AbstractView</a></i></b> (introduced in
<b class='since'>DOM Level 2</b>)</dt>

<dd>
<p>A base interface that all views shall derive from.</p>

<dl>
<dt><br />
<b>IDL Definition</b></dt>

<dd>
<div class='idl-code'>
<pre>
// Introduced in DOM Level 2:
interface AbstractView {
  readonly attribute DocumentView     document;
};
</pre>
</div>

<br />
</dd>

<dt><b>Attributes</b></dt>

<dd>
<dl>
<dt><code class='attribute-name'><a
id="Views-AbstractView-document"
name='Views-AbstractView-document'>document</a></code> of type <a
href='views.html#Views-DocumentView'><code>DocumentView</code></a>,
readonly</dt>

<dd>The source <a
href='views.html#Views-DocumentView'><code>DocumentView</code></a>
of which this is an <code>AbstractView</code>.<br />
</dd>
</dl>
</dd>
</dl>
</dd>

<dt><b>Interface <i><a id="Views-DocumentView"
name='Views-DocumentView'>DocumentView</a></i></b> (introduced in
<b class='since'>DOM Level 2</b>)</dt>

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

<dl>
<dt><br />
<b>IDL Definition</b></dt>

<dd>
<div class='idl-code'>
<pre>
// Introduced in DOM Level 2:
interface DocumentView {
  readonly attribute AbstractView     defaultView;
};
</pre>
</div>

<br />
</dd>

<dt><b>Attributes</b></dt>

<dd>
<dl>
<dt><code class='attribute-name'><a
id="Views-DocumentView-defaultView"
name='Views-DocumentView-defaultView'>defaultView</a></code> of
type <a
href='views.html#Views-AbstractView'><code>AbstractView</code></a>,
readonly</dt>

<dd>The default <a
href='views.html#Views-AbstractView'><code>AbstractView</code></a>
for this <code>Document</code>, or <code>null</code> if none
available.<br />
</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</div>

<!-- div2 Views-Interfaces --></div>

<!-- div1 Views -->
<div class='navbar' align='center'>
<hr title='Navigation area separator' />
<a accesskey='p' href='copyright-notice.html'>previous</a> &nbsp;
<a accesskey='n' href='idl-definitions.html'>next</a> &nbsp; <a
accesskey='c' href='Overview.html#contents'>contents</a> &nbsp; <a
accesskey='i' href='def-index.html'>index</a></div>
</body>
</html>

