previous   next   contents   objects   index

WD-DOM-Level-2-19990923

Appendix B: 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/WD-DOM-Level-2-19990923/idl.zip

B.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;


  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);
    // 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:
    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               removeNamedItemNS(in DOMString namespaceURI, 
                                         in DOMString name)
                                        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);
    void               normalize();
    // 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 localName, 
                                      in DOMString value)
                                        raises(DOMException);
    // Introduced in DOM Level 2:
    void               removeAttributeNS(in DOMString namespacURI, 
                                         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;
  };

  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);
  };
};

#endif // _DOM_IDL_

B.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::Element Element;
  typedef dom::NodeList NodeList;

  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);
    Element            getElementById(in DOMString elementId);
    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);
    void               deleteRow(in long index);
  };

  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);
    void               deleteRow(in long index);
  };

  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);
    void               deleteCell(in long index);
  };

  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_

B.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_

B.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        cssText;
                                        // 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);
  };

  interface LinkStyle {
    readonly attribute StyleSheet       sheet;
  };

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

#endif // _STYLESHEETS_IDL_

B.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;

  exception CSSException {
    unsigned short   code;
  };

  // CSSExceptionCode
  const unsigned short      SYNTAX_ERR                     = 0;
  const unsigned short      INVALID_MODIFICATION_ERR       = 1;


  // 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(CSSException, 
                                        //        dom::DOMException) on setting

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

  // Introduced in DOM Level 2:
  interface CSSStyleRule : CSSRule {
             attribute DOMString        selectorText;
                                        // raises(CSSException, 
                                        //        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, 
                                               CSSException);
    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(CSSException, 
                                        //        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(CSSException, 
                                        //        dom::DOMException) on setting

  };

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

  // Introduced in DOM Level 2:
  interface CSSStyleDeclaration {
             attribute DOMString        cssText;
                                        // raises(CSSException, 
                                        //        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(CSSException, 
                                               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(CSSException, 
                                        //        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                         = 9;
    const unsigned short      CSS_IN                         = 10;
    const unsigned short      CSS_PT                         = 11;
    const unsigned short      CSS_PC                         = 12;
    const unsigned short      CSS_DEG                        = 13;
    const unsigned short      CSS_RAD                        = 14;
    const unsigned short      CSS_GRAD                       = 15;
    const unsigned short      CSS_MS                         = 16;
    const unsigned short      CSS_S                          = 17;
    const unsigned short      CSS_HZ                         = 18;
    const unsigned short      CSS_KHZ                        = 19;
    const unsigned short      CSS_DIMENSION                  = 20;
    const unsigned short      CSS_STRING                     = 21;
    const unsigned short      CSS_URI                        = 22;
    const unsigned short      CSS_IDENT                      = 23;
    const unsigned short      CSS_ATTR                       = 24;
    const unsigned short      CSS_COUNTER                    = 25;
    const unsigned short      CSS_RECT                       = 26;
    const unsigned short      CSS_RGBCOLOR                   = 27;

    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 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(CSSException, 
                                               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(CSSException, 
                                               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(CSSException, 
                                        //        dom::DOMException) on setting

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

  };

  // Introduced in DOM   Level 2:
  interface CSS2CounterIncrement : CSSValue {
             attribute DOMString        identifier;
                                        // raises(CSSException, 
                                        //        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(CSSException, 
                                        //        dom::DOMException) on setting

  };

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

             attribute DOMString        uri;
                                        // raises(CSSException, 
                                        //        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(CSSException, 
                                        //        dom::DOMException) on setting

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

  };

  // Introduced in DOM Level 2:
  interface CSS2FontFaceWidths {
             attribute DOMString        urange;
                                        // raises(CSSException, 
                                        //        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(CSSException, 
                                               dom::DOMException);
  };

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

             attribute DOMString        zIndex;
                                        // raises(CSSException, 
                                        //        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, 
                                               CSSException);
    void               deleteRule(in unsigned long index)
                                        raises(dom::DOMException);
  };

  interface ViewCSS : views::AbstractView {
    CSSStyleDeclaration getComputedStyle(in Element elt, 
                                         in DOMString pseudoElt);
  };

  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);
  };

  // Introduced in DOM   Level 2:
  interface HTMLElementCSS : html::HTMLElement {
    readonly attribute CSSStyleDeclaration  style;
  };
};

#endif // _CSS_IDL_

B.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:
  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(dom::DOMException);
  };

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

  // Introduced in DOM Level 2:
  interface Event {
    // PhaseType
    const unsigned short      BUBBLING_PHASE                 = 1;
    const unsigned short      CAPTURING_PHASE                = 2;
    const unsigned short      AT_TARGET                      = 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               preventBubble();
    void               preventCapture();
    void               preventDefault();
    void               initEvent(in DOMString eventTypeArg, 
                                 in boolean canBubbleArg, 
                                 in boolean cancelableArg);
  };

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

  // Introduced in DOM Level 2:
  interface UIEvent : Event {
    readonly attribute views::AbstractView  view;
    readonly attribute unsigned short   detail;
    void               initUIEvent(in DOMString typeArg, 
                                   in boolean canBubbleArg, 
                                   in boolean cancelableArg, 
                                   in views::AbstractView viewArg, 
                                   in unsigned short 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 KeyEvent : UIEvent {
    // VirtualKeyCode
    const unsigned long       CHAR_UNDEFINED                 = 0x0FFFF;
    const unsigned long       DOM_VK_0                       = 0x30;
    const unsigned long       DOM_VK_1                       = 0x31;
    const unsigned long       DOM_VK_2                       = 0x32;
    const unsigned long       DOM_VK_3                       = 0x33;
    const unsigned long       DOM_VK_4                       = 0x34;
    const unsigned long       DOM_VK_5                       = 0x35;
    const unsigned long       DOM_VK_6                       = 0x36;
    const unsigned long       DOM_VK_7                       = 0x37;
    const unsigned long       DOM_VK_8                       = 0x38;
    const unsigned long       DOM_VK_9                       = 0x39;
    const unsigned long       DOM_VK_A                       = 0x41;
    const unsigned long       DOM_VK_ACCEPT                  = 0x1E;
    const unsigned long       DOM_VK_ADD                     = 0x6B;
    const unsigned long       DOM_VK_AGAIN                   = 0xFFC9;
    const unsigned long       DOM_VK_ALL_CANDIDATES          = 0x0100;
    const unsigned long       DOM_VK_ALPHANUMERIC            = 0x00F0;
    const unsigned long       DOM_VK_ALT                     = 0x12;
    const unsigned long       DOM_VK_ALT_GRAPH               = 0xFF7E;
    const unsigned long       DOM_VK_AMPERSAND               = 0x96;
    const unsigned long       DOM_VK_ASTERISK                = 0x97;
    const unsigned long       DOM_VK_AT                      = 0x0200;
    const unsigned long       DOM_VK_B                       = 0x42;
    const unsigned long       DOM_VK_BACK_QUOTE              = 0xC0;
    const unsigned long       DOM_VK_BACK_SLASH              = 0x5C;
    const unsigned long       DOM_VK_BACK_SPACE              = 0x08;
    const unsigned long       DOM_VK_BRACELEFT               = 0xA1;
    const unsigned long       DOM_VK_BRACERIGHT              = 0xA2;
    const unsigned long       DOM_VK_C                       = 0x43;
    const unsigned long       DOM_VK_CANCEL                  = 0x03;
    const unsigned long       DOM_VK_CAPS_LOCK               = 0x14;
    const unsigned long       DOM_VK_CIRCUMFLEX              = 0x0202;
    const unsigned long       DOM_VK_CLEAR                   = 0x0C;
    const unsigned long       DOM_VK_CLOSE_BRACKET           = 0x5D;
    const unsigned long       DOM_VK_CODE_INPUT              = 0x0102;
    const unsigned long       DOM_VK_COLON                   = 0x0201;
    const unsigned long       DOM_VK_COMMA                   = 0x2C;
    const unsigned long       DOM_VK_COMPOSE                 = 0xFF20;
    const unsigned long       DOM_VK_CONTROL                 = 0x11;
    const unsigned long       DOM_VK_CONVERT                 = 0x1C;
    const unsigned long       DOM_VK_COPY                    = 0xFFCD;
    const unsigned long       DOM_VK_CUT                     = 0xFFD1;
    const unsigned long       DOM_VK_D                       = 0x44;
    const unsigned long       DOM_VK_DEAD_ABOVEDOT           = 0x86;
    const unsigned long       DOM_VK_DEAD_ABOVERING          = 0x88;
    const unsigned long       DOM_VK_DEAD_ACUTE              = 0x81;
    const unsigned long       DOM_VK_DEAD_BREVE              = 0x85;
    const unsigned long       DOM_VK_DEAD_CARON              = 0x8A;
    const unsigned long       DOM_VK_DEAD_CEDILLA            = 0x8B;
    const unsigned long       DOM_VK_DEAD_CIRCUMFLEX         = 0x82;
    const unsigned long       DOM_VK_DEAD_DIAERESIS          = 0x87;
    const unsigned long       DOM_VK_DEAD_DOUBLEACUTE        = 0x89;
    const unsigned long       DOM_VK_DEAD_GRAVE              = 0x80;
    const unsigned long       DOM_VK_DEAD_IOTA               = 0x8D;
    const unsigned long       DOM_VK_DEAD_MACRON             = 0x84;
    const unsigned long       DOM_VK_DEAD_OGONEK             = 0x8C;
    const unsigned long       DOM_VK_DEAD_SEMIVOICED_SOUND   = 0x8F;
    const unsigned long       DOM_VK_DEAD_TILDE              = 0x83;
    const unsigned long       DOM_VK_DEAD_VOICED_SOUND       = 0x8E;
    const unsigned long       DOM_VK_DECIMAL                 = 0x6E;
    const unsigned long       DOM_VK_DELETE                  = 0x7F;
    const unsigned long       DOM_VK_DIVIDE                  = 0x6F;
    const unsigned long       DOM_VK_DOLLAR                  = 0x0203;
    const unsigned long       DOM_VK_DOWN                    = 0x28;
    const unsigned long       DOM_VK_E                       = 0x45;
    const unsigned long       DOM_VK_END                     = 0x23;
    const unsigned long       DOM_VK_ENTER                   = 0x0D;
    const unsigned long       DOM_VK_EQUALS                  = 0x3D;
    const unsigned long       DOM_VK_ESCAPE                  = 0x1B;
    const unsigned long       DOM_VK_EURO_SIGN               = 0x0204;
    const unsigned long       DOM_VK_EXCLAMATION_MARK        = 0x0205;
    const unsigned long       DOM_VK_F                       = 0x46;
    const unsigned long       DOM_VK_F1                      = 0x70;
    const unsigned long       DOM_VK_F10                     = 0x79;
    const unsigned long       DOM_VK_F11                     = 0x7A;
    const unsigned long       DOM_VK_F12                     = 0x7B;
    const unsigned long       DOM_VK_F13                     = 0xF000;
    const unsigned long       DOM_VK_F14                     = 0xF001;
    const unsigned long       DOM_VK_F15                     = 0xF002;
    const unsigned long       DOM_VK_F16                     = 0xF003;
    const unsigned long       DOM_VK_F17                     = 0xF004;
    const unsigned long       DOM_VK_F18                     = 0xF005;
    const unsigned long       DOM_VK_F19                     = 0xF006;
    const unsigned long       DOM_VK_F2                      = 0x71;
    const unsigned long       DOM_VK_F20                     = 0xF007;
    const unsigned long       DOM_VK_F21                     = 0xF008;
    const unsigned long       DOM_VK_F22                     = 0xF009;
    const unsigned long       DOM_VK_F23                     = 0xF00A;
    const unsigned long       DOM_VK_F24                     = 0xF00B;
    const unsigned long       DOM_VK_F3                      = 0x72;
    const unsigned long       DOM_VK_F4                      = 0x73;
    const unsigned long       DOM_VK_F5                      = 0x74;
    const unsigned long       DOM_VK_F6                      = 0x75;
    const unsigned long       DOM_VK_F7                      = 0x76;
    const unsigned long       DOM_VK_F8                      = 0x77;
    const unsigned long       DOM_VK_F9                      = 0x78;
    const unsigned long       DOM_VK_FINAL                   = 0x18;
    const unsigned long       DOM_VK_FIND                    = 0xFFD0;
    const unsigned long       DOM_VK_FULL_WIDTH              = 0x00F3;
    const unsigned long       DOM_VK_G                       = 0x47;
    const unsigned long       DOM_VK_GREATER                 = 0xA0;
    const unsigned long       DOM_VK_H                       = 0x48;
    const unsigned long       DOM_VK_HALF_WIDTH              = 0x00F4;
    const unsigned long       DOM_VK_HELP                    = 0x9C;
    const unsigned long       DOM_VK_HIRAGANA                = 0x00F2;
    const unsigned long       DOM_VK_HOME                    = 0x24;
    const unsigned long       DOM_VK_I                       = 0x49;
    const unsigned long       DOM_VK_INSERT                  = 0x9B;
    const unsigned long       DOM_VK_INVERTED_EXCLAMATION_MARK = 0x0206;
    const unsigned long       DOM_VK_J                       = 0x4A;
    const unsigned long       DOM_VK_JAPANESE_HIRAGANA       = 0x0104;
    const unsigned long       DOM_VK_JAPANESE_KATAKANA       = 0x0103;
    const unsigned long       DOM_VK_JAPANESE_ROMAN          = 0x0105;
    const unsigned long       DOM_VK_K                       = 0x4B;
    const unsigned long       DOM_VK_KANA                    = 0x15;
    const unsigned long       DOM_VK_KANJI                   = 0x19;
    const unsigned long       DOM_VK_KATAKANA                = 0x00F1;
    const unsigned long       DOM_VK_KP_DOWN                 = 0xE1;
    const unsigned long       DOM_VK_KP_LEFT                 = 0xE2;
    const unsigned long       DOM_VK_KP_RIGHT                = 0xE3;
    const unsigned long       DOM_VK_KP_UP                   = 0xE0;
    const unsigned long       DOM_VK_L                       = 0x4C;
    const unsigned long       DOM_VK_LEFT                    = 0x25;
    const unsigned long       DOM_VK_LEFT_PARENTHESIS        = 0x0207;
    const unsigned long       DOM_VK_LESS                    = 0x99;
    const unsigned long       DOM_VK_M                       = 0x4D;
    const unsigned long       DOM_VK_META                    = 0x9D;
    const unsigned long       DOM_VK_MINUS                   = 0x2D;
    const unsigned long       DOM_VK_MODECHANGE              = 0x1F;
    const unsigned long       DOM_VK_MULTIPLY                = 0x6A;
    const unsigned long       DOM_VK_N                       = 0x4E;
    const unsigned long       DOM_VK_NONCONVERT              = 0x1D;
    const unsigned long       DOM_VK_NUM_LOCK                = 0x90;
    const unsigned long       DOM_VK_NUMBER_SIGN             = 0x0208;
    const unsigned long       DOM_VK_NUMPAD0                 = 0x60;
    const unsigned long       DOM_VK_NUMPAD1                 = 0x61;
    const unsigned long       DOM_VK_NUMPAD2                 = 0x62;
    const unsigned long       DOM_VK_NUMPAD3                 = 0x63;
    const unsigned long       DOM_VK_NUMPAD4                 = 0x64;
    const unsigned long       DOM_VK_NUMPAD5                 = 0x65;
    const unsigned long       DOM_VK_NUMPAD6                 = 0x66;
    const unsigned long       DOM_VK_NUMPAD7                 = 0x67;
    const unsigned long       DOM_VK_NUMPAD8                 = 0x68;
    const unsigned long       DOM_VK_NUMPAD9                 = 0x69;
    const unsigned long       DOM_VK_O                       = 0x4F;
    const unsigned long       DOM_VK_OPEN_BRACKET            = 0x5B;
    const unsigned long       DOM_VK_P                       = 0x50;
    const unsigned long       DOM_VK_PAGE_DOWN               = 0x22;
    const unsigned long       DOM_VK_PAGE_UP                 = 0x21;
    const unsigned long       DOM_VK_PASTE                   = 0xFFCF;
    const unsigned long       DOM_VK_PAUSE                   = 0x13;
    const unsigned long       DOM_VK_PERIOD                  = 0x2E;
    const unsigned long       DOM_VK_PLUS                    = 0x0209;
    const unsigned long       DOM_VK_PREVIOUS_CANDIDATE      = 0x0101;
    const unsigned long       DOM_VK_PRINTSCREEN             = 0x9A;
    const unsigned long       DOM_VK_PROPS                   = 0xFFCA;
    const unsigned long       DOM_VK_Q                       = 0x51;
    const unsigned long       DOM_VK_QUOTE                   = 0xDE;
    const unsigned long       DOM_VK_QUOTEDBL                = 0x98;
    const unsigned long       DOM_VK_R                       = 0x52;
    const unsigned long       DOM_VK_RIGHT                   = 0x27;
    const unsigned long       DOM_VK_RIGHT_PARENTHESIS       = 0x020A;
    const unsigned long       DOM_VK_ROMAN_CHARACTERS        = 0x00F5;
    const unsigned long       DOM_VK_S                       = 0x53;
    const unsigned long       DOM_VK_SCROLL_LOCK             = 0x91;
    const unsigned long       DOM_VK_SEMICOLON               = 0x3B;
    const unsigned long       DOM_VK_SEPARATER               = 0x6C;
    const unsigned long       DOM_VK_SHIFT                   = 0x10;
    const unsigned long       DOM_VK_SLASH                   = 0x2F;
    const unsigned long       DOM_VK_SPACE                   = 0x20;
    const unsigned long       DOM_VK_STOP                    = 0xFFC8;
    const unsigned long       DOM_VK_SUBTRACT                = 0x6D;
    const unsigned long       DOM_VK_T                       = 0x54;
    const unsigned long       DOM_VK_TAB                     = 0x09;
    const unsigned long       DOM_VK_U                       = 0x55;
    const unsigned long       DOM_VK_UNDEFINED               = 0x0;
    const unsigned long       DOM_VK_UNDERSCORE              = 0x020B;
    const unsigned long       DOM_VK_UNDO                    = 0xFFCB;
    const unsigned long       DOM_VK_UP                      = 0x26;
    const unsigned long       DOM_VK_V                       = 0x56;
    const unsigned long       DOM_VK_W                       = 0x57;
    const unsigned long       DOM_VK_X                       = 0x58;
    const unsigned long       DOM_VK_Y                       = 0x59;
    const unsigned long       DOM_VK_Z                       = 0x5A;

    readonly attribute boolean          ctrlKey;
    readonly attribute boolean          shiftKey;
    readonly attribute boolean          altKey;
    readonly attribute boolean          metaKey;
    readonly attribute unsigned long    keyCode;
    readonly attribute unsigned long    charCode;
    void               initKeyEvent(in DOMString typeArg, 
                                    in boolean canBubbleArg, 
                                    in boolean cancelableArg, 
                                    in boolean ctrlKeyArg, 
                                    in boolean altKeyArg, 
                                    in boolean shiftKeyArg, 
                                    in boolean metaKeyArg, 
                                    in unsigned long keyCodeArg, 
                                    in unsigned long charCodeArg, 
                                    in views::AbstractView viewArg);
  };

  // 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_

B.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;
    // 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;

    readonly attribute NodeFilter       filter;
    readonly attribute boolean          expandEntityReferences;
    Node               nextNode();
    Node               previousNode();
  };

  // 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;

    short              acceptNode(in Node n);
  };

  // Introduced in DOM Level 2:
  interface TreeWalker {
    readonly attribute long             whatToShow;
    // 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;

    readonly attribute NodeFilter       filter;
    readonly attribute boolean          expandEntityReferences;
             attribute Node             currentNode;
    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_

B.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_ENDPOINTS_ERR              = 201;
  const unsigned short      INVALID_NODE_TYPE_ERR          = 202;
  const unsigned short      NULL_NODE_ERR                  = 203;


  // Introduced in DOM Level 2:
  interface Range {
    readonly attribute Node             startContainer;
    readonly attribute long             startOffset;
    readonly attribute Node             endContainer;
    readonly attribute long             endOffset;
    readonly attribute boolean          isCollapsed;
    readonly attribute Node             commonAncestorContainer;
    void               setStart(in Node refNode, 
                                in long offset)
                                        raises(RangeException);
    void               setEnd(in Node refNode, 
                              in long offset)
                                        raises(RangeException);
    void               setStartBefore(in Node refNode)
                                        raises(RangeException);
    void               setStartAfter(in Node refNode)
                                        raises(RangeException);
    void               setEndBefore(in Node refNode)
                                        raises(RangeException);
    void               setEndAfter(in Node refNode)
                                        raises(RangeException);
    void               collapse(in boolean toStart);
    void               selectNode(in Node refNode)
                                        raises(RangeException);
    void               selectNodeContents(in Node refNode)
                                        raises(RangeException);

    typedef enum CompareHow_ {
      StartToStart,
      StartToEnd,
      EndToEnd,
      EndToStart
    } CompareHow;
    short              compareEndPoints(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();
    DOMString          toString();
  };

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

#endif // _RANGE_IDL_


previous   next   contents   objects   index