<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: views.xml 225913 2001-06-01 11:15:37Z dims $ -->
<div1 id="Views">
  <head>Document Object Model Views</head>
  <orglist role="editors">
    <member>
      <name>Arnaud Le Hors</name>
      <affiliation>IBM</affiliation>
    </member>
    <member>
      <name>Laurence Cable</name>
      <affiliation>Sun Microsystems</affiliation>
    </member>
  </orglist>
  <?GENERATE-MINI-TOC?>

  <div2 id='Views-intro'>
    <head>Introduction</head>

    <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 <code>AbstractView</code> interface which
      provides a base interface from which all such views shall derive. It
      defines an attribute which references the target document of the 
      <code>AbstractView</code>. The only semantics of the <code>AbstractView</code>
      defined here create an association between a view and its target document.</p>

    <p>There are no subinterfaces of <code>AbstractView</code> defined in the DOM 
      Level 2.</p>

    <p>However, <code>AbstractView</code> is defined in and used in this Level 
      in two places:</p>
      <ulist>
       <item><p>A Document may implement a <code>DocumentView</code> 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
        <code>AbstractView</code> or obtaining the <code>DocumentView</code> 
        attribute).</p></item>
      
       <item><p>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 <code>AbstractView</code>
        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.</p></item></ulist>

    <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 <bibref
      ref="DOMCore"/>. Please refer to additional information about <xspecref
      href='&core.latest.url;/introduction.html#ID-Conformance'>conformance in
      the DOM Level 2 Core specification</xspecref>.
    </p>

  </div2>

  <div2 id='Views-Interfaces'>
    <head>Interfaces</head>

    <definitions>
      <interface name="AbstractView" id="Views-AbstractView"
	since="DOM Level 2">
	<descr>
	  <p>A base interface that all views shall derive from.</p>
	</descr>
	<attribute id="Views-AbstractView-document" type="DocumentView" name="document" readonly="yes">
	  <descr>
	    <p>The source <code>DocumentView</code> of which this is an
	      <code>AbstractView</code>.</p>
	  </descr>
	</attribute>
      </interface>

      <interface name="DocumentView" id="Views-DocumentView"
	since="DOM Level 2">
	<descr>
	  <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>
	</descr>
	<attribute id="Views-DocumentView-defaultView" type="AbstractView" name="defaultView" readonly="yes">
	  <descr>
	    <p>The default <code>AbstractView</code> for this
	      <code>Document</code>, or <code>null</code> if none
	      available.</p>
	  </descr>
	</attribute>
      </interface>
    </definitions>
  </div2>
</div1>
