previous   next   contents   objects   index

CR-DOM-Level-2-19991210

Appendix C: IDL Definitions

This appendix contains the complete OMG IDL for the Level 2 Document Object Model definitions. The definitions are divided into Core, HTML, Stylesheets, CSS, Events, TreeWalkers, Filters, and Iterators, and Range.

The IDL files are also available as: http://www.w3.org/TR/1999/CR-DOM-Level-2-19991210/idl.zip

C.1: Document Object Model Core

dom.idl:

// File: dom.idl
#ifndef _DOM_IDL_
#define _DOM_IDL_

#pragma prefix "w3c.org"
module dom
{
  typedef sequence<unsigned short> DOMString;

  interface DocumentType;
  interface Document;
  interface NodeList;
  interface NamedNodeMap;
  interface Element;

  exception DOMException {
    unsigned short   code;
  };

  // ExceptionCode
  const unsigned short      INDEX_SIZE_ERR                 = 1;
  const unsigned short      DOMSTRING_SIZE_ERR             = 2;
  const unsigned short      HIERARCHY_REQUEST_ERR          = 3;
  const unsigned short      WRONG_DOCUMENT_ERR             = 4;
  const unsigned short      INVALID_CHARACTER_ERR          = 5;
  const unsigned short      NO_DATA_ALLOWED_ERR            = 6;
  const unsigned short      NO_MODIFICATION_ALLOWED_ERR    = 7;
  const unsigned short      NOT_FOUND_ERR                  = 8;
  const unsigned short      NOT_SUPPORTED_ERR              = 9;
  const unsigned short      INUSE_ATTRIBUTE_ERR            = 10;
  // Introduced in DOM Level 2:
  const unsigned short      INVALID_STATE_ERR              = 11;
  // Introduced in DOM Level 2:
  const unsigned short      SYNTAX_ERR                     = 12;
  // Introduced in DOM Level 2:
  const unsigned short      INVALID_MODIFICATION_ERR       = 13;
  // Introduced in DOM Level 2:
  const unsigned short      NAMESPACE_ERR                  = 14;
  // Introduced in DOM Level 2:
  const unsigned short      INVALID_ACCESS_ERR             = 15;


  interface DOMImplementation {
    boolean            hasFeature(in DOMString feature, 
                                  in DOMString version);
    // Introduced in DOM Level 2:
    DocumentType       createDocumentType(in DOMString qualifiedName, 
                                          in DOMString publicId, 
                                          in DOMString systemId, 
                                          in DOMString internalSubset);
    // Introduced in DOM Level 2:
    Document           createDocument(in DOMString namespaceURI, 
                                      in DOMString qualifiedName, 
                                      in DocumentType doctype)
                                        raises(DOMException);
  };

  interface Node {
    // NodeType
    const unsigned short      ELEMENT_NODE                   = 1;
    const unsigned short      ATTRIBUTE_NODE                 = 2;
    const unsigned short      TEXT_NODE                      = 3;
    const unsigned short      CDATA_SECTION_NODE             = 4;
    const unsigned short      ENTITY_REFERENCE_NODE          = 5;
    const unsigned short      ENTITY_NODE                    = 6;
    const unsigned short      PROCESSING_INSTRUCTION_NODE    = 7;
    const unsigned short      COMMENT_NODE                   = 8;
    const unsigned short      DOCUMENT_NODE                  = 9;
    const unsigned short      DOCUMENT_TYPE_NODE             = 10;
    const unsigned short      DOCUMENT_FRAGMENT_NODE         = 11;
    const unsigned short      NOTATION_NODE                  = 12;

    readonly attribute DOMString        nodeName;
             attribute DOMString        nodeValue;
                                        // raises(DOMException) on setting
                                        // raises(DOMException) on retrieval

    readonly attribute unsigned short   nodeType;
    readonly attribute Node             parentNode;
    readonly attribute NodeList         childNodes;
    readonly attribute Node             firstChild;
    readonly attribute Node             lastChild;
    readonly attribute Node             previousSibling;
    readonly attribute Node             nextSibling;
    readonly attribute NamedNodeMap     attributes;
    // Modified in DOM Level 2:
    readonly attribute Document         ownerDocument;
    Node               insertBefore(in Node newChild, 
                                    in Node refChild)
                                        raises(DOMException);
    Node               replaceChild(in Node newChild, 
                                    in Node oldChild)
                                        raises(DOMException);
    Node               removeChild(in Node oldChild)
                                        raises(DOMException);
    Node               appendChild(in Node newChild)
                                        raises(DOMException);
    boolean            hasChildNodes();
    Node               cloneNode(in boolean deep);
    // Introduced in DOM Level 2:
    void               normalize();
    // Introduced in DOM Level 2:
    boolean            supports(in DOMString feature, 
                                in DOMString version);
    // Introduced in DOM Level 2:
    readonly attribute DOMString        namespaceURI;
    // Introduced in DOM Level 2:
             attribute DOMString        prefix;
                                        // raises(DOMException) on setting

    // Introduced in DOM Level 2:
    readonly attribute DOMString        localName;
  };

  interface NodeList {
    Node               item(in unsigned long index);
    readonly attribute unsigned long    length;
  };

  interface NamedNodeMap {
    Node               getNamedItem(in DOMString name);
    Node               setNamedItem(in Node arg)
                                        raises(DOMException);
    Node               removeNamedItem(in DOMString name)
                                        raises(DOMException);
    Node               item(in unsigned long index);
    readonly attribute unsigned long    length;
    // Introduced in DOM Level 2:
    Node               getNamedItemNS(in DOMString namespaceURI, 
                                      in DOMString localName);
    // Introduced in DOM Level 2:
    Node               setNamedItemNS(in Node arg)
                                        raises(DOMException);
    // Introduced in DOM Level 2:
    Node               removeNamedItemNS(in DOMString namespaceURI, 
                                         in DOMString localName)
                                        raises(DOMException);
  };

  interface CharacterData : Node {
             attribute DOMString        data;
                                        // raises(DOMException) on setting
                                        // raises(DOMException) on retrieval

    readonly attribute unsigned long    length;
    DOMString          substringData(in unsigned long offset, 
                                     in unsigned long count)
                                        raises(DOMException);
    void               appendData(in DOMString arg)
                                        raises(DOMException);
    void               insertData(in unsigned long offset, 
                                  in DOMString arg)
                                        raises(DOMException);
    void               deleteData(in unsigned long offset, 
                                  in unsigned long count)
                                        raises(DOMException);
    void               replaceData(in unsigned long offset, 
                                   in unsigned long count, 
                                   in DOMString arg)
                                        raises(DOMException);
  };

  interface Attr : Node {
    readonly attribute DOMString        name;
    readonly attribute boolean          specified;
             attribute DOMString        value;
                                        // raises(DOMException) on setting

    // Introduced in DOM Level 2:
    readonly attribute Element          ownerElement;
  };

  interface Element : Node {
    readonly attribute DOMString        tagName;
    DOMString          getAttribute(in DOMString name);
    void               setAttribute(in DOMString name, 
                                    in DOMString value)
                                        raises(DOMException);
    void               removeAttribute(in DOMString name)
                                        raises(DOMException);
    Attr               getAttributeNode(in DOMString name);
    Attr               setAttributeNode(in Attr newAttr)
                                        raises(DOMException);
    Attr               removeAttributeNode(in Attr oldAttr)
                                        raises(DOMException);
    NodeList           getElementsByTagName(in DOMString name);
    // Introduced in DOM Level 2:
    DOMString          getAttributeNS(in DOMString namespaceURI, 
                                      in DOMString localName);
    // Introduced in DOM Level 2:
    void               setAttributeNS(in DOMString namespaceURI, 
                                      in DOMString qualifiedName, 
                                      in DOMString value)
                                        raises(DOMException);
    // Introduced in DOM Level 2:
    void               removeAttributeNS(in DOMString namespaceURI, 
                                         in DOMString localName)
                                        raises(DOMException);
    // Introduced in DOM Level 2:
    Attr               getAttributeNodeNS(in DOMString namespaceURI, 
                                          in DOMString localName);
    // Introduced in DOM Level 2:
    Attr               setAttributeNodeNS(in Attr newAttr)
                                        raises(DOMException);
    // Introduced in DOM Level 2:
    NodeList           getElementsByTagNameNS(in DOMString namespaceURI, 
                                              in DOMString localName);
  };

  interface Text : CharacterData {
    Text               splitText(in unsigned long offset)
                                        raises(DOMException);
  };

  interface Comment : CharacterData {
  };

  interface CDATASection : Text {
  };

  interface DocumentType : Node {
    readonly attribute DOMString        name;
    readonly attribute NamedNodeMap     entities;
    readonly attribute NamedNodeMap     notations;
    // Introduced in DOM Level 2:
    readonly attribute DOMString        publicId;
    // Introduced in DOM Level 2:
    readonly attribute DOMString        systemId;
    // Introduced in DOM Level 2:
    readonly attribute DOMString        internalSubset;
  };

  interface Notation : Node {
    readonly attribute DOMString        publicId;
    readonly attribute DOMString        systemId;
  };

  interface Entity : Node {
    readonly attribute DOMString        publicId;
    readonly attribute DOMString        systemId;
    readonly attribute DOMString        notationName;
  };

  interface EntityReference : Node {
  };

  interface ProcessingInstruction : Node {
    readonly attribute DOMString        target;
             attribute DOMString        data;
                                        // raises(DOMException) on setting

  };

  interface DocumentFragment : Node {
  };

  interface Document : Node {
    readonly attribute DocumentType     doctype;
    readonly attribute DOMImplementation  implementation;
    readonly attribute Element          documentElement;
    Element            createElement(in DOMString tagName)
                                        raises(DOMException);
    DocumentFragment   createDocumentFragment();
    Text               createTextNode(in DOMString data);
    Comment            createComment(in DOMString data);
    CDATASection       createCDATASection(in DOMString data)
                                        raises(DOMException);
    ProcessingInstruction createProcessingInstruction(in DOMString target, 
                                                      in DOMString data)
                                        raises(DOMException);
    Attr               createAttribute(in DOMString name)
                                        raises(DOMException);
    EntityReference    createEntityReference(in DOMString name)
                                        raises(DOMException);
    NodeList           getElementsByTagName(in DOMString tagname);
    // Introduced in DOM Level 2:
    Node               importNode(in Node importedNode, 
                                  in boolean deep)
                                        raises(DOMException);
    // Introduced in DOM Level 2:
    Element            createElementNS(in DOMString namespaceURI, 
                                       in DOMString qualifiedName)
                                        raises(DOMException);
    // Introduced in DOM Level 2:
    Attr               createAttributeNS(in DOMString namespaceURI, 
                                         in DOMString qualifiedName)
                                        raises(DOMException);
    // Introduced in DOM Level 2:
    NodeList           getElementsByTagNameNS(in DOMString namespaceURI, 
                                              in DOMString localName);
    // Introduced in DOM Level 2:
    Element            getElementById(in DOMString elementId);
  };
};

#endif // _DOM_IDL_

C.2: Document Object Model HTML

html.idl:

// File: html.idl
#ifndef _HTML_IDL_
#define _HTML_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module html
{
  typedef dom::DOMString DOMString;
  typedef dom::Node Node;
  typedef dom::DOMImplementation DOMImplementation;
  typedef dom::Document Document;
  typedef dom::NodeList NodeList;
  typedef dom::Element Element;

  interface HTMLDocument;
  interface HTMLElement;
  interface HTMLFormElement;
  interface HTMLTableCaptionElement;
  interface HTMLTableSectionElement;

  interface HTMLCollection {
    readonly attribute unsigned long    length;
    Node               item(in unsigned long index);
    Node               namedItem(in DOMString name);
  };

  // Introduced in DOM Level 2:
  interface HTMLDOMImplementation : DOMImplementation {
    HTMLDocument       createHTMLDocument(in DOMString title);
  };

  interface HTMLDocument : Document {
             attribute DOMString        title;
    readonly attribute DOMString        referrer;
    readonly attribute DOMString        domain;
    readonly attribute DOMString        URL;
             attribute HTMLElement      body;
    readonly attribute HTMLCollection   images;
    readonly attribute HTMLCollection   applets;
    readonly attribute HTMLCollection   links;
    readonly attribute HTMLCollection   forms;
    readonly attribute HTMLCollection   anchors;
             attribute DOMString        cookie;
    void               open();
    void               close();
    void               write(in DOMString text);
    void               writeln(in DOMString text);
    NodeList           getElementsByName(in DOMString elementName);
  };

  interface HTMLElement : Element {
             attribute DOMString        id;
             attribute DOMString        title;
             attribute DOMString        lang;
             attribute DOMString        dir;
             attribute DOMString        className;
  };

  interface HTMLHtmlElement : HTMLElement {
             attribute DOMString        version;
  };

  interface HTMLHeadElement : HTMLElement {
             attribute DOMString        profile;
  };

  interface HTMLLinkElement : HTMLElement {
             attribute boolean          disabled;
             attribute DOMString        charset;
             attribute DOMString        href;
             attribute DOMString        hreflang;
             attribute DOMString        media;
             attribute DOMString        rel;
             attribute DOMString        rev;
             attribute DOMString        target;
             attribute DOMString        type;
  };

  interface HTMLTitleElement : HTMLElement {
             attribute DOMString        text;
  };

  interface HTMLMetaElement : HTMLElement {
             attribute DOMString        content;
             attribute DOMString        httpEquiv;
             attribute DOMString        name;
             attribute DOMString        scheme;
  };

  interface HTMLBaseElement : HTMLElement {
             attribute DOMString        href;
             attribute DOMString        target;
  };

  interface HTMLIsIndexElement : HTMLElement {
    readonly attribute HTMLFormElement  form;
             attribute DOMString        prompt;
  };

  interface HTMLStyleElement : HTMLElement {
             attribute boolean          disabled;
             attribute DOMString        media;
             attribute DOMString        type;
  };

  interface HTMLBodyElement : HTMLElement {
             attribute DOMString        aLink;
             attribute DOMString        background;
             attribute DOMString        bgColor;
             attribute DOMString        link;
             attribute DOMString        text;
             attribute DOMString        vLink;
  };

  interface HTMLFormElement : HTMLElement {
    readonly attribute HTMLCollection   elements;
    readonly attribute long             length;
             attribute DOMString        name;
             attribute DOMString        acceptCharset;
             attribute DOMString        action;
             attribute DOMString        enctype;
             attribute DOMString        method;
             attribute DOMString        target;
    void               submit();
    void               reset();
  };

  interface HTMLSelectElement : HTMLElement {
    readonly attribute DOMString        type;
             attribute long             selectedIndex;
             attribute DOMString        value;
    readonly attribute long             length;
    readonly attribute HTMLFormElement  form;
    readonly attribute HTMLCollection   options;
             attribute boolean          disabled;
             attribute boolean          multiple;
             attribute DOMString        name;
             attribute long             size;
             attribute long             tabIndex;
    void               add(in HTMLElement element, 
                           in HTMLElement before);
    void               remove(in long index);
    void               blur();
    void               focus();
  };

  interface HTMLOptGroupElement : HTMLElement {
             attribute boolean          disabled;
             attribute DOMString        label;
  };

  interface HTMLOptionElement : HTMLElement {
    readonly attribute HTMLFormElement  form;
             attribute boolean          defaultSelected;
    readonly attribute DOMString        text;
    readonly attribute long             index;
             attribute boolean          disabled;
             attribute DOMString        label;
             attribute boolean          selected;
             attribute DOMString        value;
  };

  interface HTMLInputElement : HTMLElement {
             attribute DOMString        defaultValue;
             attribute boolean          defaultChecked;
    readonly attribute HTMLFormElement  form;
             attribute DOMString        accept;
             attribute DOMString        accessKey;
             attribute DOMString        align;
             attribute DOMString        alt;
             attribute boolean          checked;
             attribute boolean          disabled;
             attribute long             maxLength;
             attribute DOMString        name;
             attribute boolean          readOnly;
             attribute DOMString        size;
             attribute DOMString        src;
             attribute long             tabIndex;
    readonly attribute DOMString        type;
             attribute DOMString        useMap;
             attribute DOMString        value;
    void               blur();
    void               focus();
    void               select();
    void               click();
  };

  interface HTMLTextAreaElement : HTMLElement {
             attribute DOMString        defaultValue;
    readonly attribute HTMLFormElement  form;
             attribute DOMString        accessKey;
             attribute long             cols;
             attribute boolean          disabled;
             attribute DOMString        name;
             attribute boolean          readOnly;
             attribute long             rows;
             attribute long             tabIndex;
    readonly attribute DOMString        type;
             attribute DOMString        value;
    void               blur();
    void               focus();
    void               select();
  };

  interface HTMLButtonElement : HTMLElement {
    readonly attribute HTMLFormElement  form;
             attribute DOMString        accessKey;
             attribute boolean          disabled;
             attribute DOMString        name;
             attribute long             tabIndex;
    readonly attribute DOMString        type;
             attribute DOMString        value;
  };

  interface HTMLLabelElement : HTMLElement {
    readonly attribute HTMLFormElement  form;
             attribute DOMString        accessKey;
             attribute DOMString        htmlFor;
  };

  interface HTMLFieldSetElement : HTMLElement {
    readonly attribute HTMLFormElement  form;
  };

  interface HTMLLegendElement : HTMLElement {
    readonly attribute HTMLFormElement  form;
             attribute DOMString        accessKey;
             attribute DOMString        align;
  };

  interface HTMLUListElement : HTMLElement {
             attribute boolean          compact;
             attribute DOMString        type;
  };

  interface HTMLOListElement : HTMLElement {
             attribute boolean          compact;
             attribute long             start;
             attribute DOMString        type;
  };

  interface HTMLDListElement : HTMLElement {
             attribute boolean          compact;
  };

  interface HTMLDirectoryElement : HTMLElement {
             attribute boolean          compact;
  };

  interface HTMLMenuElement : HTMLElement {
             attribute boolean          compact;
  };

  interface HTMLLIElement : HTMLElement {
             attribute DOMString        type;
             attribute long             value;
  };

  interface HTMLDivElement : HTMLElement {
             attribute DOMString        align;
  };

  interface HTMLParagraphElement : HTMLElement {
             attribute DOMString        align;
  };

  interface HTMLHeadingElement : HTMLElement {
             attribute DOMString        align;
  };

  interface HTMLQuoteElement : HTMLElement {
             attribute DOMString        cite;
  };

  interface HTMLPreElement : HTMLElement {
             attribute long             width;
  };

  interface HTMLBRElement : HTMLElement {
             attribute DOMString        clear;
  };

  interface HTMLBaseFontElement : HTMLElement {
             attribute DOMString        color;
             attribute DOMString        face;
             attribute DOMString        size;
  };

  interface HTMLFontElement : HTMLElement {
             attribute DOMString        color;
             attribute DOMString        face;
             attribute DOMString        size;
  };

  interface HTMLHRElement : HTMLElement {
             attribute DOMString        align;
             attribute boolean          noShade;
             attribute DOMString        size;
             attribute DOMString        width;
  };

  interface HTMLModElement : HTMLElement {
             attribute DOMString        cite;
             attribute DOMString        dateTime;
  };

  interface HTMLAnchorElement : HTMLElement {
             attribute DOMString        accessKey;
             attribute DOMString        charset;
             attribute DOMString        coords;
             attribute DOMString        href;
             attribute DOMString        hreflang;
             attribute DOMString        name;
             attribute DOMString        rel;
             attribute DOMString        rev;
             attribute DOMString        shape;
             attribute long             tabIndex;
             attribute DOMString        target;
             attribute DOMString        type;
    void               blur();
    void               focus();
  };

  interface HTMLImageElement : HTMLElement {
             attribute DOMString        lowSrc;
             attribute DOMString        name;
             attribute DOMString        align;
             attribute DOMString        alt;
             attribute DOMString        border;
             attribute DOMString        height;
             attribute DOMString        hspace;
             attribute boolean          isMap;
             attribute DOMString        longDesc;
             attribute DOMString        src;
             attribute DOMString        useMap;
             attribute DOMString        vspace;
             attribute DOMString        width;
  };

  interface HTMLObjectElement : HTMLElement {
    readonly attribute HTMLFormElement  form;
             attribute DOMString        code;
             attribute DOMString        align;
             attribute DOMString        archive;
             attribute DOMString        border;
             attribute DOMString        codeBase;
             attribute DOMString        codeType;
             attribute DOMString        data;
             attribute boolean          declare;
             attribute DOMString        height;
             attribute DOMString        hspace;
             attribute DOMString        name;
             attribute DOMString        standby;
             attribute long             tabIndex;
             attribute DOMString        type;
             attribute DOMString        useMap;
             attribute DOMString        vspace;
             attribute DOMString        width;
  };

  interface HTMLParamElement : HTMLElement {
             attribute DOMString        name;
             attribute DOMString        type;
             attribute DOMString        value;
             attribute DOMString        valueType;
  };

  interface HTMLAppletElement : HTMLElement {
             attribute DOMString        align;
             attribute DOMString        alt;
             attribute DOMString        archive;
             attribute DOMString        code;
             attribute DOMString        codeBase;
             attribute DOMString        height;
             attribute DOMString        hspace;
             attribute DOMString        name;
             attribute DOMString        object;
             attribute DOMString        vspace;
             attribute DOMString        width;
  };

  interface HTMLMapElement : HTMLElement {
    readonly attribute HTMLCollection   areas;
             attribute DOMString        name;
  };

  interface HTMLAreaElement : HTMLElement {
             attribute DOMString        accessKey;
             attribute DOMString        alt;
             attribute DOMString        coords;
             attribute DOMString        href;
             attribute boolean          noHref;
             attribute DOMString        shape;
             attribute long             tabIndex;
             attribute DOMString        target;
  };

  interface HTMLScriptElement : HTMLElement {
             attribute DOMString        text;
             attribute DOMString        htmlFor;
             attribute DOMString        event;
             attribute DOMString        charset;
             attribute boolean          defer;
             attribute DOMString        src;
             attribute DOMString        type;
  };

  interface HTMLTableElement : HTMLElement {
             attribute HTMLTableCaptionElement  caption;
             attribute HTMLTableSectionElement  tHead;
             attribute HTMLTableSectionElement  tFoot;
    readonly attribute HTMLCollection   rows;
    readonly attribute HTMLCollection   tBodies;
             attribute DOMString        align;
             attribute DOMString        bgColor;
             attribute DOMString        border;
             attribute DOMString        cellPadding;
             attribute DOMString        cellSpacing;
             attribute DOMString        frame;
             attribute DOMString        rules;
             attribute DOMString        summary;
             attribute DOMString        width;
    HTMLElement        createTHead();
    void               deleteTHead();
    HTMLElement        createTFoot();
    void               deleteTFoot();
    HTMLElement        createCaption();
    void               deleteCaption();
    HTMLElement        insertRow(in long index)
                                        raises(dom::DOMException);
    void               deleteRow(in long index)
                                        raises(dom::DOMException);
  };

  interface HTMLTableCaptionElement : HTMLElement {
             attribute DOMString        align;
  };

  interface HTMLTableColElement : HTMLElement {
             attribute DOMString        align;
             attribute DOMString        ch;
             attribute DOMString        chOff;
             attribute long             span;
             attribute DOMString        vAlign;
             attribute DOMString        width;
  };

  interface HTMLTableSectionElement : HTMLElement {
             attribute DOMString        align;
             attribute DOMString        ch;
             attribute DOMString        chOff;
             attribute DOMString        vAlign;
    readonly attribute HTMLCollection   rows;
    HTMLElement        insertRow(in long index)
                                        raises(dom::DOMException);
    void               deleteRow(in long index)
                                        raises(dom::DOMException);
  };

  interface HTMLTableRowElement : HTMLElement {
    readonly attribute long             rowIndex;
    readonly attribute long             sectionRowIndex;
    readonly attribute HTMLCollection   cells;
             attribute DOMString        align;
             attribute DOMString        bgColor;
             attribute DOMString        ch;
             attribute DOMString        chOff;
             attribute DOMString        vAlign;
    HTMLElement        insertCell(in long index)
                                        raises(dom::DOMException);
    void               deleteCell(in long index)
                                        raises(dom::DOMException);
  };

  interface HTMLTableCellElement : HTMLElement {
    readonly attribute long             cellIndex;
             attribute DOMString        abbr;
             attribute DOMString        align;
             attribute DOMString        axis;
             attribute DOMString        bgColor;
             attribute DOMString        ch;
             attribute DOMString        chOff;
             attribute long             colSpan;
             attribute DOMString        headers;
             attribute DOMString        height;
             attribute boolean          noWrap;
             attribute long             rowSpan;
             attribute DOMString        scope;
             attribute DOMString        vAlign;
             attribute DOMString        width;
  };

  interface HTMLFrameSetElement : HTMLElement {
             attribute DOMString        cols;
             attribute DOMString        rows;
  };

  interface HTMLFrameElement : HTMLElement {
             attribute DOMString        frameBorder;
             attribute DOMString        longDesc;
             attribute DOMString        marginHeight;
             attribute DOMString        marginWidth;
             attribute DOMString        name;
             attribute boolean          noResize;
             attribute DOMString        scrolling;
             attribute DOMString        src;
  };

  interface HTMLIFrameElement : HTMLElement {
             attribute DOMString        align;
             attribute DOMString        frameBorder;
             attribute DOMString        height;
             attribute DOMString        longDesc;
             attribute DOMString        marginHeight;
             attribute DOMString        marginWidth;
             attribute DOMString        name;
             attribute DOMString        scrolling;
             attribute DOMString        src;
             attribute DOMString        width;
  };
};

#endif // _HTML_IDL_

C.3: Document Object Model Views

views.idl:

// File: views.idl
#ifndef _VIEWS_IDL_
#define _VIEWS_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module views
{
  interface DocumentView;

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

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

#endif // _VIEWS_IDL_

C.4: Document Object Model Stylesheets

stylesheets.idl:

// File: stylesheets.idl
#ifndef _STYLESHEETS_IDL_
#define _STYLESHEETS_IDL_

#include "dom.idl"
#include "html.idl"

#pragma prefix "dom.w3c.org"
module stylesheets
{
  typedef dom::DOMString DOMString;
  typedef dom::Node Node;

  interface MediaList;

  // Introduced in DOM Level 2:
  interface StyleSheet {
    readonly attribute DOMString        type;
             attribute boolean          disabled;
    readonly attribute Node             ownerNode;
    readonly attribute StyleSheet       parentStyleSheet;
    readonly attribute DOMString        href;
    readonly attribute DOMString        title;
    readonly attribute MediaList        media;
  };

  // Introduced in DOM Level 2:
  interface StyleSheetList {
    readonly attribute unsigned long    length;
    StyleSheet         item(in unsigned long index);
  };

  // Introduced in DOM Level 2:
  interface MediaList {
             attribute DOMString        mediaText;
                                        // raises(dom::DOMException) on setting

    readonly attribute unsigned long    length;
    DOMString          item(in unsigned long index);
    void               delete(in DOMString oldMedium)
                                        raises(dom::DOMException);
    void               append(in DOMString newMedium)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface LinkStyle {
    readonly attribute StyleSheet       sheet;
  };

  // Introduced in DOM Level 2:
  interface DocumentStyle {
    readonly attribute StyleSheetList   styleSheets;
  };
};

#endif // _STYLESHEETS_IDL_

C.5: Document Object Model CSS

css.idl:

// File: css.idl
#ifndef _CSS_IDL_
#define _CSS_IDL_

#include "dom.idl"
#include "stylesheets.idl"
#include "html.idl"
#include "views.idl"

#pragma prefix "dom.w3c.org"
module css
{
  typedef dom::DOMString DOMString;
  typedef dom::Element Element;
  typedef dom::DOMImplementation DOMImplementation;

  interface CSSRule;
  interface CSSStyleSheet;
  interface CSSStyleDeclaration;
  interface CSSValue;
  interface Counter;
  interface Rect;
  interface RGBColor;

  // Introduced in DOM Level 2:
  interface CSSRuleList {
    readonly attribute unsigned long    length;
    CSSRule            item(in unsigned long index);
  };

  // Introduced in DOM Level 2:
  interface CSSRule {
    // RuleType
    const unsigned short      UNKNOWN_RULE                   = 0;
    const unsigned short      STYLE_RULE                     = 1;
    const unsigned short      CHARSET_RULE                   = 2;
    const unsigned short      IMPORT_RULE                    = 3;
    const unsigned short      MEDIA_RULE                     = 4;
    const unsigned short      FONT_FACE_RULE                 = 5;
    const unsigned short      PAGE_RULE                      = 6;

    readonly attribute unsigned short   type;
             attribute DOMString        cssText;
                                        // raises(dom::DOMException) on setting

    readonly attribute CSSStyleSheet    parentStyleSheet;
    readonly attribute CSSRule          parentRule;
  };

  // Introduced in DOM Level 2:
  interface CSSStyleRule : CSSRule {
             attribute DOMString        selectorText;
                                        // raises(dom::DOMException) on setting

    readonly attribute CSSStyleDeclaration  style;
  };

  // Introduced in DOM Level 2:
  interface CSSMediaRule : CSSRule {
    readonly attribute stylesheets::MediaList  media;
    readonly attribute CSSRuleList      cssRules;
    unsigned long      insertRule(in DOMString rule, 
                                  in unsigned long index)
                                        raises(dom::DOMException);
    void               deleteRule(in unsigned long index)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface CSSFontFaceRule : CSSRule {
    readonly attribute CSSStyleDeclaration  style;
  };

  // Introduced in DOM Level 2:
  interface CSSPageRule : CSSRule {
             attribute DOMString        selectorText;
                                        // raises(dom::DOMException) on setting

    readonly attribute CSSStyleDeclaration  style;
  };

  // Introduced in DOM Level 2:
  interface CSSImportRule : CSSRule {
    readonly attribute DOMString        href;
    readonly attribute stylesheets::MediaList  media;
    readonly attribute CSSStyleSheet    styleSheet;
  };

  // Introduced in DOM Level 2:
  interface CSSCharsetRule : CSSRule {
             attribute DOMString        encoding;
                                        // raises(dom::DOMException) on setting

  };

  // Introduced in DOM Level 2:
  interface CSSUnknownRule : CSSRule {
  };

  // Introduced in DOM Level 2:
  interface CSSStyleDeclaration {
             attribute DOMString        cssText;
                                        // raises(dom::DOMException) on setting

    DOMString          getPropertyValue(in DOMString propertyName);
    CSSValue           getPropertyCSSValue(in DOMString propertyName);
    DOMString          removeProperty(in DOMString propertyName)
                                        raises(dom::DOMException);
    DOMString          getPropertyPriority(in DOMString propertyName);
    void               setProperty(in DOMString propertyName, 
                                   in DOMString value, 
                                   in DOMString priority)
                                        raises(dom::DOMException);
    readonly attribute unsigned long    length;
    DOMString          item(in unsigned long index);
    readonly attribute CSSRule          parentRule;
  };

  // Introduced in DOM Level 2:
  interface CSSValue {
    // UnitTypes
    const unsigned short      CSS_INHERIT                    = 0;
    const unsigned short      CSS_PRIMITIVE_VALUE            = 1;
    const unsigned short      CSS_VALUE_LIST                 = 2;
    const unsigned short      CSS_CUSTOM                     = 3;

             attribute DOMString        cssText;
                                        // raises(dom::DOMException) on setting

    readonly attribute unsigned short   valueType;
  };

  // Introduced in DOM Level 2:
  interface CSSPrimitiveValue : CSSValue {
    // UnitTypes
    const unsigned short      CSS_UNKNOWN                    = 0;
    const unsigned short      CSS_NUMBER                     = 1;
    const unsigned short      CSS_PERCENTAGE                 = 2;
    const unsigned short      CSS_EMS                        = 3;
    const unsigned short      CSS_EXS                        = 4;
    const unsigned short      CSS_PX                         = 5;
    const unsigned short      CSS_CM                         = 6;
    const unsigned short      CSS_MM                         = 7;
    const unsigned short      CSS_IN                         = 8;
    const unsigned short      CSS_PT                         = 9;
    const unsigned short      CSS_PC                         = 10;
    const unsigned short      CSS_DEG                        = 11;
    const unsigned short      CSS_RAD                        = 12;
    const unsigned short      CSS_GRAD                       = 13;
    const unsigned short      CSS_MS                         = 14;
    const unsigned short      CSS_S                          = 15;
    const unsigned short      CSS_HZ                         = 16;
    const unsigned short      CSS_KHZ                        = 17;
    const unsigned short      CSS_DIMENSION                  = 18;
    const unsigned short      CSS_STRING                     = 19;
    const unsigned short      CSS_URI                        = 20;
    const unsigned short      CSS_IDENT                      = 21;
    const unsigned short      CSS_ATTR                       = 22;
    const unsigned short      CSS_COUNTER                    = 23;
    const unsigned short      CSS_RECT                       = 24;
    const unsigned short      CSS_RGBCOLOR                   = 25;

    readonly attribute unsigned short   primitiveType;
    void               setFloatValue(in unsigned short unitType, 
                                     in float floatValue)
                                        raises(dom::DOMException);
    float              getFloatValue(in unsigned short unitType)
                                        raises(dom::DOMException);
    void               setStringValue(in unsigned short stringType, 
                                      in DOMString stringValue)
                                        raises(dom::DOMException);
    DOMString          getStringValue()
                                        raises(dom::DOMException);
    Counter            getCounterValue()
                                        raises(dom::DOMException);
    Rect               getRectValue()
                                        raises(dom::DOMException);
    RGBColor           getRGBColorValue()
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface CSSValueList : CSSValue {
    readonly attribute unsigned long    length;
    CSSValue           item(in unsigned long index);
  };

  // Introduced in DOM Level 2:
  interface RGBColor {
    readonly attribute CSSPrimitiveValue  red;
    readonly attribute CSSPrimitiveValue  green;
    readonly attribute CSSPrimitiveValue  blue;
  };

  // Introduced in DOM Level 2:
  interface Rect {
    readonly attribute CSSPrimitiveValue  top;
    readonly attribute CSSPrimitiveValue  right;
    readonly attribute CSSPrimitiveValue  bottom;
    readonly attribute CSSPrimitiveValue  left;
  };

  // Introduced in DOM Level 2:
  interface Counter {
    readonly attribute DOMString        identifier;
    readonly attribute DOMString        listStyle;
    readonly attribute DOMString        separator;
  };

  // Introduced in DOM Level 2:
  interface ElementCSSInlineStyle {
    readonly attribute CSSStyleDeclaration  style;
  };

  // Introduced in DOM Level 2:
  interface CSS2Azimuth : CSSValue {
    readonly attribute unsigned short   azimuthType;
    readonly attribute DOMString        identifier;
    readonly attribute boolean          behind;
    void               setAngleValue(in unsigned short uType, 
                                     in float fValue)
                                        raises(dom::DOMException);
    float              getAngleValue(in unsigned short uType)
                                        raises(dom::DOMException);
    void               setIdentifier(in DOMString ident, 
                                     in boolean b)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface CSS2BackgroundPosition : CSSValue {
    readonly attribute unsigned short   horizontalType;
    readonly attribute unsigned short   verticalType;
    readonly attribute DOMString        horizontalIdentifier;
    readonly attribute DOMString        verticalIdentifier;
    float              getHorizontalPosition(in float hType)
                                        raises(dom::DOMException);
    float              getVerticalPosition(in float vType)
                                        raises(dom::DOMException);
    void               setHorizontalPosition(in unsigned short hType, 
                                             in float value)
                                        raises(dom::DOMException);
    void               setVerticalPosition(in unsigned short vType, 
                                           in float value)
                                        raises(dom::DOMException);
    void               setPositionIdentifier(in DOMString hIdentifier, 
                                             in DOMString vIdentifier)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface CSS2BorderSpacing : CSSValue {
    readonly attribute unsigned short   horizontalType;
    readonly attribute unsigned short   verticalType;
    float              getHorizontalSpacing(in float hType)
                                        raises(dom::DOMException);
    float              getVerticalSpacing(in float vType)
                                        raises(dom::DOMException);
    void               setHorizontalSpacing(in unsigned short hType, 
                                            in float value)
                                        raises(dom::DOMException);
    void               setVerticalSpacing(in unsigned short vType, 
                                          in float value)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level   2:
  interface CSS2CounterReset : CSSValue {
             attribute DOMString        identifier;
                                        // raises(dom::DOMException) on setting

             attribute short            reset;
                                        // raises(dom::DOMException) on setting

  };

  // Introduced in DOM   Level 2:
  interface CSS2CounterIncrement : CSSValue {
             attribute DOMString        identifier;
                                        // raises(dom::DOMException) on setting

             attribute short            increment;
                                        // raises(dom::DOMException) on setting

  };

  // Introduced in DOM Level 2:
  interface CSS2Cursor : CSSValue {
    readonly attribute CSSValueList     uris;
             attribute DOMString        predefinedCursor;
                                        // raises(dom::DOMException) on setting

  };

  // Introduced in DOM Level 2:
  interface CSS2PlayDuring : CSSValue {
    readonly attribute unsigned short   playDuringType;
             attribute DOMString        playDuringIdentifier;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        uri;
                                        // raises(dom::DOMException) on setting

             attribute boolean          mix;
                                        // raises(dom::DOMException) on setting

             attribute boolean          repeat;
                                        // raises(dom::DOMException) on setting

  };

  // Introduced in DOM Level 2:
  interface CSS2TextShadow {
    readonly attribute CSSValue         color;
    readonly attribute CSSValue         horizontal;
    readonly attribute CSSValue         vertical;
    readonly attribute CSSValue         blur;
  };

  // Introduced in DOM Level 2:
  interface CSS2FontFaceSrc {
             attribute DOMString        uri;
                                        // raises(dom::DOMException) on setting

    readonly attribute CSSValueList     format;
             attribute DOMString        fontFaceName;
                                        // raises(dom::DOMException) on setting

  };

  // Introduced in DOM Level 2:
  interface CSS2FontFaceWidths {
             attribute DOMString        urange;
                                        // raises(dom::DOMException) on setting

    readonly attribute CSSValueList     numbers;
  };

  // Introduced in DOM Level 2:
  interface CSS2PageSize : CSSValue {
    readonly attribute unsigned short   widthType;
    readonly attribute unsigned short   heightType;
    readonly attribute DOMString        identifier;
    float              getWidth(in float wType)
                                        raises(dom::DOMException);
    float              getHeightSize(in float hType)
                                        raises(dom::DOMException);
    void               setWidthSize(in unsigned short wType, 
                                    in float value)
                                        raises(dom::DOMException);
    void               setHeightSize(in unsigned short hType, 
                                     in float value)
                                        raises(dom::DOMException);
    void               setIdentifier(in DOMString ident)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface CSS2Properties {
             attribute DOMString        azimuth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        background;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        backgroundAttachment;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        backgroundColor;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        backgroundImage;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        backgroundPosition;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        backgroundRepeat;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        border;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderCollapse;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderColor;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderSpacing;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderStyle;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderTop;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderRight;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderBottom;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderLeft;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderTopColor;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderRightColor;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderBottomColor;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderLeftColor;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderTopStyle;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderRightStyle;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderBottomStyle;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderLeftStyle;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderTopWidth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderRightWidth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderBottomWidth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderLeftWidth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        borderWidth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        bottom;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        captionSide;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        clear;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        clip;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        color;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        content;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        counterIncrement;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        counterReset;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        cue;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        cueAfter;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        cueBefore;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        cursor;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        direction;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        display;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        elevation;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        emptyCells;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        cssFloat;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        font;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        fontFamily;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        fontSize;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        fontSizeAdjust;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        fontStretch;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        fontStyle;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        fontVariant;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        fontWeight;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        height;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        left;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        letterSpacing;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        lineHeight;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        listStyle;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        listStyleImage;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        listStylePosition;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        listStyleType;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        margin;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        marginTop;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        marginRight;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        marginBottom;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        marginLeft;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        markerOffset;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        marks;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        maxHeight;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        maxWidth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        minHeight;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        minWidth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        orphans;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        outline;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        outlineColor;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        outlineStyle;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        outlineWidth;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        overflow;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        padding;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        paddingTop;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        paddingRight;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        paddingBottom;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        paddingLeft;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        page;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        pageBreakAfter;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        pageBreakBefore;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        pageBreakInside;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        pause;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        pauseAfter;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        pauseBefore;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        pitch;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        pitchRange;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        playDuring;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        position;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        quotes;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        richness;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        right;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        size;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        speak;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        speakHeader;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        speakNumeral;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        speakPunctuation;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        speechRate;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        stress;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        tableLayout;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        textAlign;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        textDecoration;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        textIndent;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        textShadow;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        textTransform;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        top;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        unicodeBidi;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        verticalAlign;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        visibility;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        voiceFamily;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        volume;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        whiteSpace;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        widows;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        width;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        wordSpacing;
                                        // raises(dom::DOMException) on setting

             attribute DOMString        zIndex;
                                        // raises(dom::DOMException) on setting

  };

  // Introduced in DOM Level 2:
  interface CSSStyleSheet : stylesheets::StyleSheet {
    readonly attribute CSSRule          ownerRule;
    readonly attribute CSSRuleList      cssRules;
    unsigned long      insertRule(in DOMString rule, 
                                  in unsigned long index)
                                        raises(dom::DOMException);
    void               deleteRule(in unsigned long index)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface ViewCSS : views::AbstractView {
    CSSStyleDeclaration getComputedStyle(in Element elt, 
                                         in DOMString pseudoElt);
  };

  // Introduced in DOM Level 2:
  interface DocumentCSS : stylesheets::DocumentStyle {
    CSSStyleDeclaration getOverrideStyle(in Element elt, 
                                         in DOMString pseudoElt);
  };

  // Introduced in DOM   Level 2:
  interface DOMImplementationCSS : DOMImplementation {
    CSSStyleSheet      createCSSStyleSheet(in DOMString title, 
                                           inout DOMString media);
  };
};

#endif // _CSS_IDL_

C.6: Document Object Model Events

events.idl:

// File: events.idl
#ifndef _EVENTS_IDL_
#define _EVENTS_IDL_

#include "dom.idl"
#include "views.idl"

#pragma prefix "dom.w3c.org"
module events
{
  typedef dom::DOMString DOMString;
  typedef dom::Node Node;

  interface EventListener;
  interface Event;

  // Introduced in DOM Level 2:
  exception EventException {
    unsigned short   code;
  };

  // EventExceptionCode
  const unsigned short      UNSPECIFIED_EVENT_TYPE_ERR     = 0;


  // Introduced in DOM Level 2:
  interface EventTarget {
    void               addEventListener(in DOMString type, 
                                        in EventListener listener, 
                                        in boolean useCapture);
    void               removeEventListener(in DOMString type, 
                                           in EventListener listener, 
                                           in boolean useCapture);
    boolean            dispatchEvent(in Event evt)
                                        raises(EventException);
  };

  // Introduced in DOM Level 2:
  interface EventListener {
    void               handleEvent(in Event evt);
  };

  // Introduced in DOM Level 2:
  interface Event {
    // PhaseType
    const unsigned short      CAPTURING_PHASE                = 1;
    const unsigned short      AT_TARGET                      = 2;
    const unsigned short      BUBBLING_PHASE                 = 3;

    readonly attribute DOMString        type;
    readonly attribute EventTarget      target;
    readonly attribute Node             currentNode;
    readonly attribute unsigned short   eventPhase;
    readonly attribute boolean          bubbles;
    readonly attribute boolean          cancelable;
    void               stopPropagation();
    void               preventDefault();
    void               initEvent(in DOMString eventTypeArg, 
                                 in boolean canBubbleArg, 
                                 in boolean cancelableArg);
  };

  // Introduced in DOM Level 2:
  interface DocumentEvent {
    Event              createEvent(in DOMString eventType)
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface UIEvent : Event {
    readonly attribute views::AbstractView  view;
    readonly attribute long             detail;
    void               initUIEvent(in DOMString typeArg, 
                                   in boolean canBubbleArg, 
                                   in boolean cancelableArg, 
                                   in views::AbstractView viewArg, 
                                   in long detailArg);
  };

  // Introduced in DOM Level 2:
  interface MouseEvent : UIEvent {
    readonly attribute long             screenX;
    readonly attribute long             screenY;
    readonly attribute long             clientX;
    readonly attribute long             clientY;
    readonly attribute boolean          ctrlKey;
    readonly attribute boolean          shiftKey;
    readonly attribute boolean          altKey;
    readonly attribute boolean          metaKey;
    readonly attribute unsigned short   button;
    readonly attribute Node             relatedNode;
    void               initMouseEvent(in DOMString typeArg, 
                                      in boolean canBubbleArg, 
                                      in boolean cancelableArg, 
                                      in views::AbstractView viewArg, 
                                      in unsigned short detailArg, 
                                      in long screenXArg, 
                                      in long screenYArg, 
                                      in long clientXArg, 
                                      in long clientYArg, 
                                      in boolean ctrlKeyArg, 
                                      in boolean altKeyArg, 
                                      in boolean shiftKeyArg, 
                                      in boolean metaKeyArg, 
                                      in unsigned short buttonArg, 
                                      in Node relatedNodeArg);
  };

  // Introduced in DOM Level 2:
  interface MutationEvent : Event {
    readonly attribute Node             relatedNode;
    readonly attribute DOMString        prevValue;
    readonly attribute DOMString        newValue;
    readonly attribute DOMString        attrName;
    void               initMutationEvent(in DOMString typeArg, 
                                         in boolean canBubbleArg, 
                                         in boolean cancelableArg, 
                                         in Node relatedNodeArg, 
                                         in DOMString prevValueArg, 
                                         in DOMString newValueArg, 
                                         in DOMString attrNameArg);
  };
};

#endif // _EVENTS_IDL_

C.7: Document Object Model Traversal

traversal.idl:

// File: traversal.idl
#ifndef _TRAVERSAL_IDL_
#define _TRAVERSAL_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module traversal
{
  typedef dom::Node Node;

  interface NodeFilter;

  // Introduced in DOM Level 2:
  interface NodeIterator {
    readonly attribute long             whatToShow;
    readonly attribute NodeFilter       filter;
    readonly attribute boolean          expandEntityReferences;
    Node               nextNode()
                                        raises(dom::DOMException);
    Node               previousNode()
                                        raises(dom::DOMException);
    void               detach();
  };

  // Introduced in DOM Level 2:
  interface NodeFilter {
    // Constants returned by acceptNode
    const short               FILTER_ACCEPT                  = 1;
    const short               FILTER_REJECT                  = 2;
    const short               FILTER_SKIP                    = 3;

    // Constants for whatToShow
    const unsigned long       SHOW_ALL                       = 0x0000FFFF;
    const unsigned long       SHOW_ELEMENT                   = 0x00000001;
    const unsigned long       SHOW_ATTRIBUTE                 = 0x00000002;
    const unsigned long       SHOW_TEXT                      = 0x00000004;
    const unsigned long       SHOW_CDATA_SECTION             = 0x00000008;
    const unsigned long       SHOW_ENTITY_REFERENCE          = 0x00000010;
    const unsigned long       SHOW_ENTITY                    = 0x00000020;
    const unsigned long       SHOW_PROCESSING_INSTRUCTION    = 0x00000040;
    const unsigned long       SHOW_COMMENT                   = 0x00000080;
    const unsigned long       SHOW_DOCUMENT                  = 0x00000100;
    const unsigned long       SHOW_DOCUMENT_TYPE             = 0x00000200;
    const unsigned long       SHOW_DOCUMENT_FRAGMENT         = 0x00000400;
    const unsigned long       SHOW_NOTATION                  = 0x00000800;

    short              acceptNode(in Node n);
  };

  // Introduced in DOM Level 2:
  interface TreeWalker {
    readonly attribute long             whatToShow;
    readonly attribute NodeFilter       filter;
    readonly attribute boolean          expandEntityReferences;
             attribute Node             currentNode;
                                        // raises(dom::DOMException) on setting

    Node               parentNode();
    Node               firstChild();
    Node               lastChild();
    Node               previousSibling();
    Node               nextSibling();
    Node               previousNode();
    Node               nextNode();
  };

  // Introduced in DOM Level 2:
  interface DocumentTraversal {
    NodeIterator       createNodeIterator(in Node root, 
                                          in long whatToShow, 
                                          in NodeFilter filter, 
                                          in boolean entityReferenceExpansion);
    TreeWalker         createTreeWalker(in Node root, 
                                        in long whatToShow, 
                                        in NodeFilter filter, 
                                        in boolean entityReferenceExpansion)
                                        raises(dom::DOMException);
  };
};

#endif // _TRAVERSAL_IDL_

C.8: Document Object Model Range

range.idl:

// File: range.idl
#ifndef _RANGE_IDL_
#define _RANGE_IDL_

#include "dom.idl"

#pragma prefix "dom.w3c.org"
module range
{
  typedef dom::Node Node;
  typedef dom::DocumentFragment DocumentFragment;
  typedef dom::DOMString DOMString;

  // Introduced in DOM Level 2:
  exception RangeException {
    unsigned short   code;
  };

  // RangeExceptionCode
  const unsigned short      BAD_BOUNDARYPOINTS_ERR         = 1;
  const unsigned short      INVALID_NODE_TYPE_ERR          = 2;


  // Introduced in DOM Level 2:
  interface Range {
    readonly attribute Node             startContainer;
                                        // raises(dom::DOMException) on retrieval

    readonly attribute long             startOffset;
                                        // raises(dom::DOMException) on retrieval

    readonly attribute Node             endContainer;
                                        // raises(dom::DOMException) on retrieval

    readonly attribute long             endOffset;
                                        // raises(dom::DOMException) on retrieval

    readonly attribute boolean          isCollapsed;
                                        // raises(dom::DOMException) on retrieval

    readonly attribute Node             commonAncestorContainer;
                                        // raises(dom::DOMException) on retrieval

    void               setStart(in Node refNode, 
                                in long offset)
                                        raises(RangeException, 
                                               dom::DOMException);
    void               setEnd(in Node refNode, 
                              in long offset)
                                        raises(RangeException, 
                                               dom::DOMException);
    void               setStartBefore(in Node refNode)
                                        raises(RangeException, 
                                               dom::DOMException);
    void               setStartAfter(in Node refNode)
                                        raises(RangeException, 
                                               dom::DOMException);
    void               setEndBefore(in Node refNode)
                                        raises(RangeException, 
                                               dom::DOMException);
    void               setEndAfter(in Node refNode)
                                        raises(RangeException, 
                                               dom::DOMException);
    void               collapse(in boolean toStart)
                                        raises(dom::DOMException);
    void               selectNode(in Node refNode)
                                        raises(RangeException, 
                                               dom::DOMException);
    void               selectNodeContents(in Node refNode)
                                        raises(RangeException, 
                                               dom::DOMException);

    typedef enum CompareHow_ {
      StartToStart,
      StartToEnd,
      EndToEnd,
      EndToStart
    } CompareHow;
    short              compareBoundaryPoints(in CompareHow how, 
                                             in Range sourceRange)
                                        raises(dom::DOMException);
    void               deleteContents()
                                        raises(dom::DOMException);
    DocumentFragment   extractContents()
                                        raises(dom::DOMException);
    DocumentFragment   cloneContents()
                                        raises(dom::DOMException);
    void               insertNode(in Node newNode)
                                        raises(dom::DOMException, 
                                               RangeException);
    void               surroundContents(in Node newParent)
                                        raises(dom::DOMException, 
                                               RangeException);
    Range              cloneRange()
                                        raises(dom::DOMException);
    DOMString          toString()
                                        raises(dom::DOMException);
    void               detach()
                                        raises(dom::DOMException);
  };

  // Introduced in DOM Level 2:
  interface DocumentRange {
    Range              createRange();
  };
};

#endif // _RANGE_IDL_


previous   next   contents   objects   index