4. Document Object Model (HTML) Level 1

Editors:
Mike Champion, ArborText
Vidur Apparao, Netscape
Scott Isaacs, Microsoft (until January 1998)
Chris Wilson, Microsoft (after January 1998)

The Document Object Model (DOM) level one provides a mechanism for software developers and web script authors to access and manipulate parsed HTML and XML content. This document defines a set of objects that extends the Document Object Model (Core) such that the combination can represent all parts of a parsed HTML document. This document is meant to be concurrent with the HTML version 4.0 specification.



Introduction

This specification is part of the W3C Document Object Model, which defines a programming interface for manipulating HTML and XML documents. Objects and methods which are used for both HTML and XML documents are defined in the W3C DOM Level One Core specification, which forms the basis for the W3C DOM Level One HTML specification that you are now reading. This document extends the Level One Core specification to describe objects and methods specific to HTML documents. In general, the functionality needed to manipulate hierarchical document structures, elements, and attributes will be found in the core specification; functionality that depends on the specific elements defined in HTML will be found in this document. Another document, the W3C DOM Level One XML specification, contains methods and objects specific to XML documents.

The goals of the HTML-specific DOM specification are:

The key differences between the core DOM and the HTML application of DOM is that the HTML Document Object Model exposes a number of convenience methods and properties that are consistent with the existing models and are more appropriate to script writers. In many cases, these enhancements are not applicable to a general DOM because they rely on the presence of a predefined DTD. For DOM Level 1, the DTD for HTML 4.0 is assumed.

The W3C DOM Working Group attempts, wherever possible, to maintain compatibility with the DOM Level 0, which is defined as being the functionality exposed in Netscape Navigator 3.0 and Microsoft Internet Explorer 3.0.

More specifically, this document includes the following specializations for HTML:

The Level 1 document does not include mechanisms to access and modify style specified through CSS-1. Furthermore, it will not define an event model for HTML documents. This functionality will be specified in a future Level of this specification. The events that are supported in Level 0 are given in the DOM Level 1 HTML ECMAScript binding for completeness; the method of defining and handling events is expected to change.

HTML Application of Core DOM

Naming Conventions

The HTML DOM follows a naming convention for properties, methods, events, collections, and data types. All names are defined as one or more English words concatenated together to form a single string.

Properties and Methods

The property or method name starts with the initial keyword in lowercase, and each subsequent word starts with a capital letter. For example, a property that returns document meta information such as the date the file was created might be named "fileDateCreated". In the ECMAScript binding, properties are exposed as properties of a given object. In Java, properties are exposed with get and set methods.

HTML Document

HTMLDocument

The HTMLDocument is the root of the HTML hierarchy and contains the entire content as its descendants.

Properties

NamedNodeList images
A collection of all the images in the document
NamedNodeList applets
A collection of all the <APPLET> (deprecated element) and <OBJECT> elements in the document.
NamedNodeList links
A collection of all the <AREA> and <A HREF=...> elements in the document.
NamedNodeList forms
A collection of all the forms in the document
NamedNodeList anchors
A collection of all the <A NAME=...> elements in the document.
wstring title
The title of a document as specified by the <TITLE> tag in the head of the document.
wstring referrer
Returns the URL of the page that linked to this page. This property is an empty string if the user navigated to the page directly (not through a link, eg., from a bookmark).
wstring cookie
Assigning a cookie string is in the following format: name=value; expires=date. Retrieving the cookie a semi-colon delimited list of name, value pairs for all the cookies associated with the page.
wstring fileSize
The size of the document
wstring fileCreatedDate
A string representation of the date the document was created.
wstring fileModifiedDate
wstring fileUpdatedDate
The last update timestamp.
wstring domain
The domain name of the server that served the document.
wstring URL
The complete URL of the document.
HTMLElement body
The element that contains the content for the document. In documents with BODY contents, returns the BODY element, and in frameset documents, this returns the outermost FRAMESET element.

The following properties have been deprecated in favor of the corresponding ones for the BODY element:

alinkColor
background
bgColor
fgColor
linkColor
vlinkColor

Methods

The following methods allow a user to add to or replace the structure model of a document using strings of unparsed HTML. The Working Group is currently considering alternate methods for providing similar functionality for both HTML and XML documents. The following methods may be deprecated at some point in the future in favor of a more general-purpose mechanism.

void open();
Open a document stream for writing.
void write(in wstring text);
Write a string of text to a document. The text is parsed into the document's structure model.
void writeln(in wstring text);
Write a string of text followed by a newline character to a document. The text is parsed into the document's structure model.
void close();
Closes a document stream and forces display.

LOCATION Object

The location object parses the URL for the current page into a number of properties providing easy access. The Location object is included in the HTML-specific interface ("window") in Level 0. In a subsequent level of the DOM, the DocumentContext object will be defined as part of the core API and the Location object and its methods may be deprecated.

HTML Elements

Element

  |

  +--- HTMLElement

          |

          +--- Specific HTML

               Elements

HTMLElement Object Hierarchy

Property Attributes

All HTML attributes are exposed as properties on the element object. The name of the exposed property always uses the naming conventions, and is independent of the case of the attribute in the source document. The data type of the property is determined by the type of the attribute as determined by the HTML 4.0 DTD. The attributes have the semantics given in the HTML 4.0 specification.

The attributes are exposed as properties for compatibility with Level 0. This usage is deprecated because it can not be generalised to all possible attribute names, as is required both for XML and potentially for future versions of HTML. We are considering how best to add, get, and remove attributes in a simple and direct way.

DTD Data Type Object Model Data Type
CDATA String
Value list (e.g.. (left | right | center)) String
one-value Value list (e.g. (border)) Boolean
Number Long Integer

The return value of an attribute that has data type that is a value list is always capitalized, independent of the case of the value in the source document. For example, if the value of the align attribute on a P element is "left" then it is returned as "Left". For attributes with the CDATA data type, the value is returned with the capitalization as in the source document.

Naming Exceptions

To avoid name-space conflicts, an attribute with the same name as a keyword in one of our chosen binding languages will be prefixed. For HTML, the prefix used is "html" and for CSS, the prefix used is "css". For example, the "for" attribute collides with loop construct naming conventions and is named "htmlFor", while the CSS float attribute collides with the float data type and is named "cssFloat".

Exposing Element Type Names (tagName)

The property that exposes the element type name will return this in uppercase. For example, the body element type name is exposed through the "tagName" property as "BODY".

HTMLElement

All HTML elements derive from this class. Elements that only expose the core attributes are represented by the base HTMLElement class. These elements are as follows:

Properties

wstring title
Advisory title.
wstring lang
Language code.
wstring dir
Direction for weak/neutral text.
wstring className
the class attribute of the element. This attribute has been renamed due to conflicts with the class keyword exposed by many languages.
HTMLStyle style
RESERVED - For accessing the inline style of the element

Head Elements

LINK Element

The LINK element specifies a link to an external resource, and defines this document's relationship to that resource (or vice versa).

Properties

wstring href
The base URL
wstring charset
The character set encoding of the linked resource
wstring hreflang
Language code
wstring target
Render in this frame
wstring rel
Forward link type
wstring rev
Reverse link type
wstring type
Advisory content type
wstring media
Designed for use with specific media.
bool disabled
Enables/disables the link. This is currently only used for stylesheet links, and may be used to activate or deactive stylesheets.

TITLE Element

The document title

Properties

wstring title text
The specified title as a string

META Element

This contains generic meta-information about the document.

Properties

wstring httpEquiv
HTTP response header name
wstring content
Associated information
wstring name
Meta-information name
wstring scheme
Select form of content

BASE Element

Document base URL

Properties

wstring href
The URL
wstring target
The default target frame

ISINDEX Element

Represents the deprecated ISINDEX element in HTML (used for single-line text input).

Properties

wstring prompt
Prompt message

STYLE Element

Style information - a more detailed stylesheet object model will be defined in a separate document.

Properties

wstring type
The style sheet language (Internet media type).
bool disabled
Enables/disables the stylesheet.
wstring media
The intended destination medium for the style sheet.

BODY Element

The HTML document body. This element is always present in the DOM API, even if the tags are not present in the source document.

Properties

wstring background
URL of the background texture tile image
wstring bgColor
Background color code
wstring text
Document text color
wstring link
Color of links
wstring vLink
Color of visited links
wstring aLink
Color of active links

Form Elements

If any of the form control elements is not contained within a form, the form property returns null.

FORM Element

The form element encompasses behavior similar to a collection and an element. It provides direct access to the contained input elements as well as the attributes of the form element.

Properties

wstring action
Server-side form handler
wstring method
HTTP method used to submit form
wstring target
Render in this frame
wstring name
Name of frame for targeting
long length
Length (read-only)
wstring enctype
wstring acceptCharset
List of supported character sets
NamedNodeList elements
Returns a collection of all elements in the form

SELECT Element

The select element allows the selection of an option. The contained options can be directly accessed through the select element as a collection.

Properties

wstring type
The type of control created
long size
Number of rows visible
boolean multiple
May multiple items be selected?
wstring name
Field name
NamedNodeList options
The list of OPTION elements contained by this element.
wstring type
What kind of select element
wstring value
Property value
boolean disabled
Control unavailable in this context?
long length
Number of characters
long tabIndex
Position in tabbing order
long selectedIndex
The ordinal index of the selected item. -1 is returned if no element is selected. For multi-select list boxes, the first selected item is returned.
HTMLFormElement form
Returns the form the element is contained within. Returns null if not within the context of a form. (read-only)

Methods

void blur()
Remove keyboard focus
void focus()
Set keyboard focus
void add(in HTMLElement element, in HTMLElement before);
Add a new element to the Select collection
void remove(in long index)
Remove an element from the Select collection

OPTION Element

A selectable choice

Properties

wstring label
For use in hierarchical menus
boolean defaultSelected
Specifies the initial selection of the option (the value of the SELECTED attribute).
boolean disabled
Control unavailable in this context?
boolean selected
Specifies the current selection of the option.
wstring value
The current value of the option element.
wstring text
The text contained within the option element.
HTMLFormElement form
Returns the form the element is contained within. Returns null if not within the context of a form. (read-only)
long index
The index of this OPTION in its parent SELECT.

INPUT Element

Form control

Security Notes: Depending upon the environment the page is being viewed, the value property may be read-only for the file upload input type. For the password input type, the actual value returned may be masked to prevent unauthorized use.

Properties

wstring value
Used for radios and checkboxes
wstring name
Reflects the NAME attribute (for backwards compatibility).
boolean disabled
Control unavailable in this context?
wstring defaultValue
Value if not explicitly specified
long size
Size information - specific to each type of field
long maxLength
Maximum number of characters for text fields
boolean readOnly
For text and password
boolean checked
For radio buttons and check boxes - TRUE if explicitly set. Represents the current state of the checkbox or radio button.
boolean defaultChecked
For radio buttons and check boxes. Represents the value of the CHECKED HTML attribute.
wstring type
The type of control created (reflects the TYPE attribute).
wstring src
When the type attribute has the value "image", this attribute specifies the location of the image to be used to decorate the graphical submit button.
wstring alt
Alternate text for user agents that can't display this element.
wstring usemap
Used to associate an image map with an element.
wstring align
The horizontal alignment of the element.
long tabIndex
Index used for tab navigation.
wstring accessKey
A single character access key for the form element.
wstring accept
A comma-separated list of content types that a server processing this form will handle correctly
HTMLFormElement form
Returns the form the element is contained within. Returns null if not within the context of a form. (read-only)

Methods

void blur()
Remove keyboard focus
void focus()
Set keyboard focus
void select()
Select the contents of the textarea (for elements with a TYPE attribute of Text, File, Password)
void click()
Simulate a mouse-click (for elements with a TYPE attribute of Button, Checkbox, Radio, Reset, Submit)

TEXTAREA Element

Multi-line text field

Properties

wstring type
The type of this form control.
wstring value
Property value
wstring name
Property name
boolean disabled
Control unavailable in this context?
wstring defaultValue
Value if no input from user
boolean readOnly
Can user change the value?
long rows
Number of text rows
long cols
Width in columns
long tabIndex
Position in tabbing order
HTMLFormElement form
Returns the form the element is contained within. Returns null if not within the context of a form. (read-only).

Methods

void blur()
Remove keyboard focus
void focus()
Set keyboard focus
void select()
Select the contents of the textarea

BUTTON Element

Push button

Properties

wstring type
The type of this form control.
wstring value
Property value
wstring name
Property name
boolean disabled
Control unavailable in this context?
long tabIndex
Position in tabbing order
wstring accessKey
Accessibility key character
HTMLFormElement form
Returns the form the element is contained within. Returns null if not within the context of a form. (read-only).

LABEL Element

Form field label text

wstring htmlFor
The HTML "for" needs to be named htmlFor. For as a property name collides with the keywords of most languages.
wstring accessKey
Accessibility key character

LEGEND Element

Fieldset legend

Properties

wstring align
Text alignment relative to fieldset

List Elements

UL Elements

Unordered list.

Properties

boolean compact
Reduce inter-item spacing.
wstring type
Bullet style

OL Elements

Ordered list.

Properties

boolean compact
Reduce inter-item spacing.
wstring type
Bullet style
long start
Starting sequence number (for OL)

DL, DIR, MENU Elements

Definition list, directory list, menu list

Properties

boolean compact
Reduce inter-item spacing

LI Element

List item

Properties

wstring type
List item style
long value
Reset sequence number

Block Elements

DIV Element

Generic container

Properties

wstring align
Text alignment

P Element

Paragraph

wstring align
Text alignment

H1, H2, H3, H4, H5, H6 Elements

Headings

Properties

wstring align
Text alignment

Q, BLOCKQUOTE Elements

Quoted text

Properties

wstring cite
URL for source document or message

Phrase Elements

BASEFONT Element

Base font

Properties

wstring color
Font color
wstring face
Font face id
long size
Font size

FONT Element

Local change to font

Properties

wstring color
Font color
wstring face
Font face
long size
Font size

INS & DEL Elements

Inserted or deleted text

Properties

wstring cite
Reason for change
wstring dateTime
Date and time of change

A Element

Anchor

Properties

wstring target
Render in this frame
wstring href
URL for linked resource
wstring rel
Forward link type
wstring rev
Reverse link type
wstring name
Property name
wstring accessKey
Accessibility key character
long tabIndex
Position in tabbing order
wstring charset
Character encoding of linked resource

Methods

void blur()
Remove keyboard focus
void focus()
Set keyboard focus

Replaced Elements

IMG Element

Embedded image

Properties

boolean isMap
Use server-side image map
wstring useMap
Use client side image map
wstring border
Link border width
long vspace
Vertical gutter
long hspace
Horizontal gutter
wstring alt
Short description
wstring src
Source URL
wstring align
Image alignment
long width
Override width
long height
Override height
wstring name
The NAME attribute of the element (for backward compatibility).

OBJECT Element

Generic embedded object

Note: In principle, all properties on the object element are read-write but in some environments some properties may be read-only once the underlying object is instantiated.

Properties

wstring classid
Identifies an implementation
wstring align
Vertical or horizontal alignment
wstring name
Submit as part of form
wstring codeBase
Base URL for classid, data, archive
wstring codeType
Content type for code
wstring code
Code file
wstring type
Content type for data
long width
Initial width
long height
Initial height
wstring altHtml
HTML contained within the OBJECT tag that is displayed by user agents that cannot display the OBJECT itself.
long vspace
Vertical gutter
long hspace
Horizontal gutter
long tabIndex
Position in tab order
HTMLFormElement form
Returns the form the element is contained within. Returns null if not within the context of a form. (read-only).
wstring data
The location of the object's data.

Image Maps

MAP Element

Client side image map

Properties

wstring name
Name, for reference by usemap
NamedNodeList areas
Return a list of the areas in the map

AREA Element

Client side image map area

Properties

wstring shape
Controls interpretation of coordinates
wstring coords
Comma-separated list of lengths
wstring href
URL for linked resource
wstring target
Render in this frame
wstring alt
Short description
boolean noHref
This region has no action
long tabIndex
Position in tab order
wstring accessKey
Accessibility key character.

Table Elements

TABLE Element

The create* and delete* methods on the table provide easy access to construct and modify tables. HTML 4.0 defines that only 1 CAPTION, THEAD and TFOOT can exist in a table. If one exists, and the createTHead() or createTFoot() method is called, the method returns the THead or TFoot element that already exists.

Properties

long cols
Number of columns
wstring border
Border width
wstring frame
Which parts of table frame to include
wstring rules
Rulings between rows and cols
long cellSpacing
Spacing between cells
long cellPadding
Spacing within cells
wstring bgColor
Background color for cells
wstring align
Position of the table with respect to the document
long width
The desired width of the table

Methods

NamedNodeList getRows();
Get all row elements
HTMLTableSection getTHead();
Select the table head
HTMLTableSection getTFoot();
Select the table footer
NamedNodeList getTBodies();
HTMLTableCaption getCaption();
Get the table caption
HTMLElement createTHead();
void deleteTHead();
Delete the table header
HTMLElement createTFoot();
Create a table footer
void deleteTFoot();
Delete the table footer
HTMLTableCaption createCaption();
Create a caption
void deleteCaption();
Delete the caption
HTMLElement insertRow(in long index);
Insert a new blank row
void deleteRow(in long index);
Delete a row

CAPTION Element

Table Caption

Properties

wstring align
Text alignment

COLGROUP Element

Properties

long span
Used to delimit column groups
wstring align
Horizontal alignment in cells
wstring vAlign
Vertical alignment in cells
long width
Default width

THEAD, TBODY, TFOOT Elements

Properties

wstring align
Horizontal alignment in cells
wstring vAlign
Vertical alignment in cells

Methods

NamedNodeList getRows()
HTMLElement insertRow(in long index);
void deleteRow(in long index);

TR Element

The rowIndex returns the index relative to the entire table, and sectionRowIndex returns the index relative to the section the element is scoped within (THead, TFoot, or TBody)

Properties

wstring align
Horizontal alignment in cells
wstring vAlign
Vertical alignment in cells
wstring bgColor
Background color for rows

Methods

long getRowIndex();
long getSectionRowIndex();
NamedNodeList getCells();
HTMLElement insertCell(in long index);
void deleteCell(in long index);

TH, TD Element

Properties

abbr
Abbreviation for header cells
axis
Names group of related headers
headers
List of ids for header cells
scope
Scope covered by header cells
long rowSpan
Number of rows spanned by cell
long colSpan
Number of columns spanned by cell
wstring align
Horizontal alignment in cells
wstring vAlign
Vertical alignment in cells
wstring bgColor
Cell background color
boolean noWrap
Suppress word wrap
long width
Width for cell
long height
Height for cell

Methods

long getCellIndex();

Frame and related Elements

FRAMESET Element

Properties

wstring rows
List of lengths (default 100%, 1 row)
wstring cols
List of columns (default 100%, 1 col)

FRAME Element

Subwindow

Properties

wstring src
Source URL
wstring name
Name of frame, for targetting
boolean noResize
Forbid user from resizing frame?
wstring scrolling
Scrollbar or none
wstring frameBorder
Request frame borders?
long marginWidth
Margin width in pixels
long marginHeight
Margin height in pixels

IFRAME Element

Inline subwindows

Properties

wstring src
Source URL
wstring name
Name, for targetting
wstring scrolling
Scrollbar or none
wstring align
Vertical or horizontal alignment
long marginWidth;
Margin width in pixels
long marginHeight;
Margin height in pixels
long width
Frame width
long height
Frame height
long vspace
Vertical gutter
long hspace
Horizontal gutter

Miscellaneous Elements

BR Element

Forced line break

Properties

wstring clear
Control text flow

COMMENT Element

Properties

wstring text
Comment text

SCRIPT Element

Script statements

Properties

wstring src
URL of external script
wstring text
The script contained by the element.
wstring type
Content type of script language
wstring language
Predefined script language name
boolean defer
Indicates that the user agent can defer processing of the script.

HR Element

Horizontal rule

Properties

wstring align
Text alignment
boolean noShade
Indicates to the user agent that there should be no shading in the rendering of this element.
long width
Width of rule
long size
The height of the rule.

Appendix A: HTML IDL Interface definitions

This contains the complete IDL definitions for the HTML support provided by the Document Object Model.

//hb////-*-Mode: C++-*-////////////////////////////////////////////////////////
//                                                                           //
// NAME        :                                                             //
// DESCRIPTION :                                                             //
// HISTORY     :                                                             //
//                                                                           //
//he///////////////////////////////////////////////////////////////////////////



interface HTMLStyle {
  // Hook for later level
};

interface NamedNodeList {

  readonly attribute long length;
  Node item(in long index);
  Node namedItem(in wstring name);

};

interface HTMLDocument : Document
{

  // These are all methods, because they do some processing
  // of the document
  NamedNodeList  getImages();
  NamedNodeList  getApplets();
  NamedNodeList  getLinks();
  NamedNodeList  getForms();
  NamedNodeList  getAnchors();

  wstring         getCookie();
  wstring         setCookie(in wstring cookie);

  readonly attribute wstring       referrer;
  readonly attribute wstring       fileSize;
  readonly attribute wstring       fileCreatedDate;
  readonly attribute wstring       fileModifiedDate;
  readonly attribute wstring       fileUpdatedDate;
  readonly attribute wstring       title;
  readonly attribute wstring       domain;
  readonly attribute wstring       URL;

  attribute HTMLElement body;

  void      open();
  void      write(in wstring text);
  void      writeln(in wstring text);
  void      close();

};

interface HTMLElement : Element
{

  attribute wstring         className;
  attribute wstring         id;
  attribute HTMLStyle       style;
  attribute wstring         title;
  attribute wstring         lang;
  attribute wstring         dir;

};

interface HTMLLinkElement : HTMLElement
{

  attribute wstring href;
  attribute wstring rel;
  attribute wstring rev;
  attribute wstring type;
  attribute wstring media;
  attribute wstring charset;
  attribute wstring hreflang;
  attribute wstring target;
  attribute boolean disabled;

};

interface HTMLTitleElement : HTMLElement
{

  attribute wstring text;

};

interface HTMLMetaElement : HTMLElement
{

  attribute wstring httpEquiv;
  attribute wstring content;
  attribute wstring name;
  attribute wstring scheme;

};

interface HTMLBaseElement : HTMLElement
{

  attribute wstring href;
  attribute wstring target;

};

interface HTMLIsIndexElement : HTMLElement
{

  attribute wstring  prompt;

};

interface HTMLStyleElement : HTMLElement
{

  attribute wstring type;
  attribute boolean disabled;
  attribute wstring media;

};

interface HTMLBodyElement : HTMLElement
{

  attribute wstring background;
  attribute wstring bgColor;
  attribute wstring text;
  attribute wstring link;
  attribute wstring vlink;
  attribute wstring alink;

};

interface HTMLFormElement : HTMLElement
{

  attribute wstring action;
  attribute wstring method;
  attribute wstring target;
  attribute wstring name;

  readonly attribute long    length;

  attribute wstring enctype;
  attribute wstring acceptCharset;
  attribute NamedNodeList elements;

};

interface HTMLSelectElement : HTMLElement
{

  attribute long     selectedIndex;
  attribute long     size;
  attribute boolean  multiple;
  attribute wstring  name;

  readonly attribute wstring  type;

  attribute wstring  value;
  attribute boolean  disabled;
  attribute long     length;
  attribute long     tabIndex;
  readonly attribute HTMLFormElement  form;
  attribute NamedNodeList            options;

  void add(in HTMLElement element, in HTMLElement before);
  void remove(in long index);
  void blur();
  void focus();

};

interface HTMLOptionElement : HTMLElement
{

  attribute wstring         text;
  attribute long            index;
  attribute wstring         value;
  attribute boolean         defaultSelected;
  attribute boolean         disabled;
  attribute wstring         label;

  readonly attribute boolean         selected;

  readonly attribute HTMLFormElement form;

};

interface HTMLFieldSetElement : HTMLElement
{

  attribute wstring align;

};

interface HTMLLegendElement : HTMLElement
{

  attribute wstring align;

};

interface HTMLInputElement : HTMLElement
{

  readonly  attribute wstring type;

  attribute wstring  value;
  attribute wstring  name;
  attribute boolean  disabled;
  attribute wstring  defaultValue;
  attribute long     size;
  attribute long     maxLength;
  attribute boolean  readOnly;
  attribute boolean  checked;
  attribute boolean  defaultChecked;
  attribute wstring  src;
  attribute wstring  alt;
  attribute wstring  usemap;
  attribute wstring  align;
  attribute long     tabIndex;
  attribute wstring  accessKey;
  attribute wstring  accept;

  readonly attribute HTMLFormElement form;

  void blur();
  void focus();
  void select();
  void click();

};

interface HTMLTextAreaElement : HTMLElement
{

  readonly attribute wstring  type;
  attribute wstring  value;
  attribute wstring  name;
  attribute boolean  disabled;
  attribute wstring  defaultValue;
  attribute boolean  readOnly;
  attribute long     rows;
  attribute long     cols;
  attribute long     tabIndex;

  readonly attribute HTMLFormElement form;

  void blur();
  void focus();
  void select();

};

interface HTMLButtonElement : HTMLElement
{

  readonly attribute wstring  type;
  attribute wstring  value;
  attribute wstring  name;
  attribute boolean  disabled;
  attribute long     tabIndex;
  attribute wstring  accessKey;

  readonly attribute HTMLFormElement form;

};

interface HTMLLabelElement : HTMLElement
{

  attribute wstring htmlFor;
  attribute wstring accessKey;

};

interface HTMLAnchorElement : HTMLElement
{

  attribute wstring target;
  attribute wstring href;
  attribute wstring rel;
  attribute wstring rev;
  attribute wstring name;
  attribute wstring accessKey;
  attribute long    tabIndex;
  attribute wstring charset;

};

interface HTMLBaseFontElement : HTMLElement
{

  attribute wstring color;
  attribute wstring face;
  attribute long    size;

};

interface HTMLBRElement : HTMLElement
{

  attribute wstring clear;

};

interface HTMLImageElement : HTMLElement
{

  attribute boolean  isMap;
  attribute wstring  useMap;
  attribute wstring  border;
  attribute long     vspace;
  attribute long     hspace;
  attribute wstring  alt;
  attribute wstring  src;
  attribute wstring  lowSrc;
  attribute wstring  align;
  attribute long     width;
  attribute long     height;
  attribute wstring  name;

};

interface HTMLFontElement : HTMLElement
{

  attribute wstring color;
  attribute wstring face;
  attribute long    size;

};

interface HTMLModElement : HTMLElement
{

  attribute wstring cite;
  attribute wstring dateTime;

};

interface HTMLObjectElement : HTMLElement
{

  attribute wstring   classId;
  attribute wstring   data;
  attribute wstring   align;
  attribute wstring   name;
  attribute wstring   codeBase;
  attribute wstring   codeType;
  attribute wstring   code;    
  attribute wstring   type;
  attribute long      width;
  attribute long      height;
  attribute wstring   altHtml;
  attribute long      vspace;
  attribute long      hspace;
  attribute long      tabIndex;

  readonly attribute HTMLFormElement form;

};

interface HTMLQuoteElement : HTMLElement
{

  attribute wstring cite;

};

interface HTMLScriptElement : HTMLElement
{

  attribute wstring  src;
  attribute wstring  text;
  attribute wstring  type;
  attribute wstring  language;
  attribute boolean  defer;

};

interface HTMLUListElement : HTMLElement
{

  attribute boolean compact;
  attribute wstring type;

};

interface HTMLOListElement : HTMLElement
{

  attribute boolean compact;
  attribute wstring type;
  attribute long    start;

};

interface HTMLLIElement : HTMLElement
{

  attribute wstring type;
  attribute long    value;

};

interface HTMLDListElement : HTMLElement { 
  attribute boolean compact;

};

interface HTMLDivElement : HTMLElement
{

  attribute wstring align;

};

interface HTMLHRElement : HTMLElement
{

  attribute wstring  align;
  attribute boolean  noShade;
  attribute long     width;
  attribute long     size;

};

interface HTMLParagraphElement : HTMLElement
{

  attribute wstring align;

};

interface HTMLHeadingElement : HTMLElement
{

  attribute wstring align;

};

interface HTMLMapElement : HTMLElement
{

  readonly attribute NamedNodeList areas;
  attribute wstring name;

};

interface HTMLAreaElement : HTMLElement
{

  attribute wstring  shape;
  attribute wstring  coords;
  attribute wstring  href;
  attribute wstring  target;
  attribute wstring  alt;
  attribute boolean  noHref;
  attribute long     tabIndex;
  attribute wstring  accessKey;

};

interface HTMLTableCaption : HTMLElement
{

  attribute wstring align;

};

interface HTMLTable : HTMLElement
{

  attribute long               cols;
  attribute wstring            border;
  attribute wstring            frame;
  attribute wstring            rules;
  attribute long               cellSpacing;
  attribute long               cellPadding;
  attribute wstring            bgColor;
  attribute wstring            align;
  attribute long               width;
  attribute HTMLTableCaption   caption;
  readonly attribute HTMLTableSection   thead;
  readonly attribute HTMLTableSection   tfoot;

  NamedNodeList     getRows();
  NamedNodeList     getTBodies();

  HTMLElement        createTHead();
  void               deleteTHead();

  HTMLElement        createTFoot();
  void               deleteTFoot();

  HTMLTableCaption   createCaption();
  void               deleteCaption();

  HTMLElement        insertRow(in long index);
  void               deleteRow(in long index);

};

interface HTMLTableCol : HTMLElement
{

  attribute long     span;
  attribute wstring  align;
  attribute wstring  valign;
  attribute long     width;

};

interface HTMLTableSection : HTMLElement
{

  NamedNodeList getRows();
  HTMLElement insertRow(in long index);
  void        deleteRow(in long index);
  
  attribute wstring align;
  attribute wstring valign;

};

interface HTMLTableRow : HTMLElement
{

  attribute long     rowIndex;
  attribute long     sectionRowIndex;
  attribute wstring  align;
  attribute wstring  valign;
  attribute wstring  bgColor;

  NamedNodeList getCells();

  HTMLElement insertCell(in long index);
  void        deleteCell(in long index);

};

interface HTMLTableCell : HTMLElement
{

  attribute long     cellIndex;
  attribute long     rowSpan;
  attribute long     colSpan;
  attribute wstring  align;
  attribute wstring  valign;
  attribute wstring  bgColor;
  attribute boolean  noWrap;
  attribute long     width;
  attribute long     height;

};

interface HTMLCommentElement : HTMLElement
{

  attribute wstring text;

};

interface HTMLFrameSetElement : HTMLElement
{

  attribute wstring rows;
  attribute wstring cols;

};

interface HTMLFrameElement : HTMLElement
{

  attribute wstring  src;
  attribute wstring  name;
  attribute boolean  noResize;
  attribute wstring  scrolling;
  attribute wstring  frameBorder;
  attribute long     marginWidth;
  attribute long     marginHeight;

};

interface HTMLIFrameElement : HTMLElement 
{

  attribute wstring  src;
  attribute wstring  name;
  attribute wstring  scrolling;
  attribute wstring  align;
  attribute long     marginWidth;
  attribute long     marginHeight;
  attribute long     width;
  attribute long     height;

};

Appendix B: Java HTML API definitions

The Java API definitions will be added in the next public release of the HTML DOM Level One.


Appendix C: ECMAScript HTML API definitions


This will contain the ECMAScript bindings for the HTML DOM.