WD-DOM-Level-2-19981228


1. Document Object Model CSS

Editors
Vidur Apparao, Netscape Communications Corp.
Chris Wilson, Microsoft

Table of contents


1.1. Overview of the DOM Level 2 CSS Interfaces

The DOM Level 2 Cascading Style Sheets (CSS ) interfaces are designed with the goal of exposing CSS constructs to object model consumers. Cascading Style Sheets is a declarative syntax for defining presentation rules, properties and ancillary constructs used to format and render Web documents. This document specifies a mechanism to programmatically access and modify the rich style and presentation control provided by CSS (specifically CSS level two ). This augments CSS by providing a mechanism to dynamically control the inclusion and exclusion of individual style sheets, as well as manipulate CSS rules and properties.

1.2. Generic Style Sheet Interfaces

This set of interfaces represents the generic notion of style sheets. While the goal of this specification is to represent CSS style sheets, these interfaces may be applied to other types of style sheets.

Interface StyleSheet

The StyleSheet interface is the abstract base interface for any type of style sheet. It represents a single style sheet associated with a structured document. In HTML, the StyleSheet interface represents either an external style sheet, included via the HTML LINK element, or an inline STYLE element. In XML, this interface represents an external style sheet, included via a style sheet processing instruction .

IDL Definition
interface StyleSheet {
  readonly attribute  DOMString            type;
           attribute  boolean              disabled;
  readonly attribute  Node                 owningNode;
  readonly attribute  StyleSheet           parentStyleSheet;
  readonly attribute  DOMString            href;
  readonly attribute  DOMString            title;
  readonly attribute  DOMString            media;
};

Attributes
type
This specifies the style sheet language for this style sheet. The style sheet language is specified as a content type (e.g. "text/css"). The content type is often specified in the owningNode. A list of registered content types can be found at ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/ . Also see the type attribute definition for the LINK element in HTML 4.0, and the type pseudo-attribute for the XML style sheet processing instruction .
disabled
false if the style sheet is applied to the document. true if it is not.
owningNode
The node that associates this style sheet with the document. For HTML, this may be the corresponding LINK or STYLE element. For XML, it may be the linking processing instruction. For included style sheets, this attribute has a value of null.
parentStyleSheet
For style sheet languages that support the concept of style sheet inclusion, this attribute represents the including style sheet, if one exists. If the style sheet is a top-level style sheet, or the style sheet language does not support inclusion, the value of the attribute is null.
href
If the style sheet is a linked style sheet, the value of its attribute is its location. For inline style sheets, the value of this attribute is null. See the href attribute definition for the LINK element in HTML 4.0, and the href pseudo-attribute for the XML style sheet processing instruction .
title
The advisory title. The title is often specified in the owningNode. See the title attribute definition for the LINK element in HTML 4.0, and the title pseudo-attribute for the XML style sheet processing instruction .
media
The intended destination medium for style information. It may be a single media descriptor or a comma-separated list. The media is often specified in the owningNode. See the media attribute definition for the LINK element in HTML 4.0, and the media pseudo-attribute for the XML style sheet processing instruction .
Interface StyleSheetCollection

The StyleSheetCollection interface provides the abstraction of an ordered collection of style sheets.

IDL Definition
interface StyleSheetCollection {
  readonly attribute  unsigned long        length;
  StyleSheet                item(in unsigned long index);
};

Attributes
length
The length or the size of the list.
Methods
item
Used to retrieve a style sheet by ordinal index.
Parameters
index

Index into the collection

Return Value
The style sheet at the index position in the StyleSheetCollection, or null if that is not a valid index.

This method raises no exceptions.

1.3. CSS Fundamental Interfaces

The interfaces within this section are considered fundamental, and must be implemented by all conforming applications of this specification. These interfaces represent CSS style sheets specifically.

Interface CSSStyleSheet

The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i.e. a style sheet whose content type is "text/css".

IDL Definition
interface CSSStyleSheet : StyleSheet {
  readonly attribute  CSSRuleCollection    cssRules;
  unsigned long             insertRule(in DOMString rule, 
                                       in unsigned long index)
                                       raises(DOMException);
  void                      deleteRule(in unsigned long index)
                                       raises(DOMException);
};

Attributes
cssRules
The collection of all CSS rules contained within the style sheet. This includes both rule sets and at-rules .
Methods
insertRule
Used to insert a new rule into the style sheet. The new rule now becomes part of the cascade.
Parameters
rule

The parsable text representing the rule. For rule sets this contains both the selector and the style declaration. For at-rules, this specifies both the at-identifier and the rule content.

index

The index within the style sheet's rule collection of the rule before which to insert the specified rule. If the specified index is equal to the length of the style sheet's rule collection, the rule will be added to the end of the style sheet.

Return Value
The index within the style sheet's rule collection of the newly inserted rule.
Exceptions
DOMException

HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the specified index e.g. if an @import rule is inserted after a standard rule set or other at-rule.

INDEX_SIZE_ERR: Raised if the specified index is not a valid insertion point.

SYNTAX_ERR: Raised if the specified rule has a syntax error and is unparsable.


deleteRule
Used to delete a rule from the style sheet.
Parameters
index

The index within the style sheet's rule collection of the rule to remove.

Exceptions
DOMException

INDEX_SIZE_ERR: Raised if the specified index does not correspond to a rule in the style sheet's rule collection.


This method returns nothing.
Interface CSSRuleCollection

The CSSRuleCollection interface provides the abstraction of an ordered collection of CSS rules.

IDL Definition
interface CSSRuleCollection {
  readonly attribute  unsigned long        length;
  CSSRule                   item(in unsigned long index);
};

Attributes
length
The length or the size of the list.
Methods
item
Used to retrieve a CSS rule by ordinal index. The order in this collection represents the order of the rules in the CSS style sheet.
Parameters
index

Index into the collection

Return Value
The style rule at the index position in the CSSRuleCollection, or null if that is not a valid index.

This method raises no exceptions.
Interface CSSRule

The CSSRule interface is the abstract base interface for any type of CSS statement . This includes both rule sets and at-rules .

IDL Definition
interface CSSRule {
  // RuleType
  const unsigned short      UNKNOWN_RULE       = 0;
  const unsigned short      STYLE_RULE         = 1;
  const unsigned short      IMPORT_RULE        = 2;
  const unsigned short      MEDIA_RULE         = 3;
  const unsigned short      FONT_FACE_RULE     = 4;
  const unsigned short      PAGE_RULE          = 5;

  readonly attribute  unsigned short       type;
           attribute  DOMString            cssText;
  readonly attribute  CSSStyleSheet        parentStyleSheet;
};

Definition group RuleType

An integer indicating which type of rule this is.

Defined Constants
UNKNOWN_RULE

The rule is a CSSUnknownRule.

STYLE_RULE

The rule is a CSSStyleRule.

IMPORT_RULE

The rule is a CSSImportRule.

MEDIA_RULE

The rule is a CSSMediaRule.

FONT_FACE_RULE

The rule is a CSSFontFaceRule.

PAGE_RULE

The rule is a CSSPageRule.

Attributes
type
A code defining the type of the rule, as defined above.
cssText
The parsable textual representation of the rule.
parentStyleSheet
The style sheet that contains this rule.
Interface CSSStyleRule

The CSSStyleRule interface represents a single rule set in a CSS style sheet.

IDL Definition
interface CSSStyleRule : CSSRule {
           attribute  DOMString            selectorText;
  readonly attribute  CSSStyleDeclaration  style;
};

Attributes
selectorText
The textual representation of the selector for the rule set. The implementation may have stripped out insignificant whitespace while parsing the selector.
style
The declaration-block of this rule set.
Interface CSSMediaRule

The CSSMediaRule interface represents a @media rule in a CSS style sheet. A @media rule can be used to delimit style rules for specific media types.

IDL Definition
interface CSSMediaRule : CSSRule {
           attribute  DOMString            mediaTypes;
  readonly attribute  CSSRuleCollection    cssRules;
  unsigned long             insertRule(in DOMString rule, 
                                       in unsigned long index)
                                       raises(DOMException);
  void                      deleteRule(in unsigned long index);
};

Attributes
mediaTypes
A comma-separate list of media types for this rule. This attribute does not include the "@media" specifier.
cssRules
A collection of all CSS rules contained within the media block.
Methods
insertRule
Used to insert a new rule into the media block.
Parameters
rule

The parsable text representing the rule. For rule sets this contains both the selector and the style declaration. For at-rules, this specifies both the at-identifier and the rule content.

index

The index within the media block's rule collection of the rule before which to insert the specified rule. If the specified index is equal to the length of the media blocks's rule collection, the rule will be added to the end of the media block.

Return Value
The index within the media block's rule collection of the newly inserted rule.
Exceptions
DOMException

HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the specified index. e.g. if an @import rule is inserted after a standard rule set or other at-rule.

INDEX_SIZE_ERR: Raised if the specified index is not a valid insertion point.

SYNTAX_ERR: Raised if the specified rule has a syntax error and is unparsable.


deleteRule
Used to delete a rule from the media block.
Parameters
index

The index within the media block's rule collection of the rule to remove.


This method returns nothing.
This method raises no exceptions.
Interface CSSFontFaceRule

The CSSFontFaceRule interface represents a @font-face rule in a CSS style sheet. The @font-face rule is used to hold a set of font descriptions.

IDL Definition
interface CSSFontFaceRule : CSSRule {
  readonly attribute  CSSStyleDeclaration  style;
};

Attributes
style
The declaration-block of this rule.
Interface CSSPageRule

The CSSPageRule interface represents a @page rule within a CSS style sheet. The @page rule is used to specify the dimensions, orientation, margins, etc. of a page box for paged media.

IDL Definition
interface CSSPageRule : CSSRule {
           attribute  DOMString            selectorText;
  readonly attribute  CSSStyleDeclaration  style;
};

Attributes
selectorText
The parsable textual representation of the page selector for the rule.
style
The declaration-block of this rule.
Interface CSSImportRule

The CSSImportRule interface represents a @import rule within a CSS style sheet. The @import rule is used to import style rules from other style sheets.

IDL Definition
interface CSSImportRule : CSSRule {
           attribute  DOMString            href;
           attribute  DOMString            media;
  readonly attribute  CSSStyleSheet        styleSheet;
};

Attributes
href
The location of the style sheet to be imported. The attribute will not contain the "url(...)" specifier around the URI.
media
A comma-separated list of media types for which this style sheet may be used.
styleSheet
The style sheet referred to by this rule, if it has been loaded. The value of this attribute is null if the style sheet has not yet been loaded or if it will not be loaded (e.g. if the style sheet is for a media type not supported by the user agent).
Interface CSSUnknownRule

The CSSUnkownRule interface represents an at-rule not supported by this user agent.

IDL Definition
interface CSSUnknownRule : CSSRule {
};

Interface CSSStyleDeclaration

The CSSStyleDeclaration interface represents a single CSS declaration block . This interface may be used to determine the style properties currently set in a block or to set style properties explicitly within the block.

IDL Definition
interface CSSStyleDeclaration {
           attribute  DOMString            cssText;
  DOMString                 getPropertyValue(in DOMString propertyName);
  DOMString                 getPropertyPriority(in DOMString propertyName);
  void                      setProperty(in DOMString propertyName, 
                                        in DOMString value, 
                                        in DOMString priority)
                                        raises(DOMException);
  readonly attribute  unsigned long        length;
  DOMString                 item(in unsigned long index);
};

Attributes
cssText
The parsable textual representation of the declaration block (including the surrounding curly braces). Setting this attribute will result in the parsing of the new value and resetting of the properties in the declaration block.
Methods
getPropertyValue
Used the retrieve the value of a CSS property if it has been explicitly set within this declaration block.
Parameters
propertyName

The name of the CSS property. See the CSS property index .

Return Value
Returns the value of the property if it has been explicitly set for this declaration block. Returns the empty string if the property has not been set or the property name does not correspond to a valid CSS2 property.

This method raises no exceptions.
getPropertyPriority
Used to retrieve the priority of a CSS property (e.g. the "!important" qualifier) if the property has been explicitly set in this declaration block.
Parameters
propertyName

The name of the CSS property. See the CSS property index .

Return Value
A string representing the priority (e.g. "!important") if one exists. The empty string if none exists.

This method raises no exceptions.
setProperty
Used the set a property value and priority within this declaration block.
Parameters
propertyName

The name of the CSS property. See the CSS property index .

value

The new value of the property.

priority

The new priority of the property (e.g. "!important").

Exceptions
DOMException

SYNTAX_ERR: Raised if the specified value has a syntax error and is unparsable.


This method returns nothing.
Attributes
length
The number of properties that have been explicitly set in this declaration block.
Methods
item
Used to retrieve the properties that have been explicitly set in this declaration block. The order of the properties retrieved using this method does not have to be the order in which they were set. This method can be used to iterate over all properties in this declaration block.
Parameters
index

Index of the property name to retrieve.

Return Value
The name of the property at this ordinal position. The empty string if no property exists at this position.

This method raises no exceptions.

1.4. CSS Extended Interfaces

The interfaces found within this section are not mandatory. They may be implemented by a DOM implementation as a convenience to the DOM script user.

Interface CSS2Properties

The CSS2Properties interface represents a convenience mechanism for retrieving and setting properties within a CSSStyleDeclaration. The attributes of this interface correspond to all the properties specified in CSS2 . Getting an attribute of this interface is equivalent to calling the getPropertyValue method of the CSSStyleDeclaration interface. Setting an attribute of this interface is equivalent to calling the setProperty method of the CSSStyleDeclaration interface.

A compliant implementation is not required to implement the CSS2Properties interface.

IDL Definition
interface CSS2Properties {
           attribute  DOMString            azimuth;
           attribute  DOMString            background;
           attribute  DOMString            backgroundAttachment;
           attribute  DOMString            backgroundColor;
           attribute  DOMString            backgroundImage;
           attribute  DOMString            backgroundPosition;
           attribute  DOMString            backgroundRepeat;
           attribute  DOMString            border;
           attribute  DOMString            borderCollapse;
           attribute  DOMString            borderColor;
           attribute  DOMString            borderSpacing;
           attribute  DOMString            borderStyle;
           attribute  DOMString            borderTop;
           attribute  DOMString            borderRight;
           attribute  DOMString            borderBottom;
           attribute  DOMString            borderLeft;
           attribute  DOMString            borderTopColor;
           attribute  DOMString            borderRightColor;
           attribute  DOMString            borderBottomColor;
           attribute  DOMString            borderLeftColor;
           attribute  DOMString            borderTopStyle;
           attribute  DOMString            borderRightStyle;
           attribute  DOMString            borderBottomStyle;
           attribute  DOMString            borderLeftStyle;
           attribute  DOMString            borderTopWidth;
           attribute  DOMString            borderRightWidth;
           attribute  DOMString            borderBottomWidth;
           attribute  DOMString            borderLeftWidth;
           attribute  DOMString            borderWidth;
           attribute  DOMString            bottom;
           attribute  DOMString            captionSide;
           attribute  DOMString            clear;
           attribute  DOMString            clip;
           attribute  DOMString            color;
           attribute  DOMString            content;
           attribute  DOMString            counterIncrement;
           attribute  DOMString            counterReset;
           attribute  DOMString            cue;
           attribute  DOMString            cueAfter;
           attribute  DOMString            cueBefore;
           attribute  DOMString            cursor;
           attribute  DOMString            direction;
           attribute  DOMString            display;
           attribute  DOMString            elevation;
           attribute  DOMString            emptyCells;
           attribute  DOMString            cssFloat;
           attribute  DOMString            font;
           attribute  DOMString            fontFamily;
           attribute  DOMString            fontSize;
           attribute  DOMString            fontSizeAdjust;
           attribute  DOMString            fontStretch;
           attribute  DOMString            fontStyle;
           attribute  DOMString            fontVariant;
           attribute  DOMString            fontWeight;
           attribute  DOMString            height;
           attribute  DOMString            left;
           attribute  DOMString            letterSpacing;
           attribute  DOMString            lineHeight;
           attribute  DOMString            listStyle;
           attribute  DOMString            listStyleImage;
           attribute  DOMString            listStylePosition;
           attribute  DOMString            listStyleType;
           attribute  DOMString            margin;
           attribute  DOMString            marginTop;
           attribute  DOMString            marginRight;
           attribute  DOMString            marginBottom;
           attribute  DOMString            marginLeft;
           attribute  DOMString            markerOffset;
           attribute  DOMString            marks;
           attribute  DOMString            maxHeight;
           attribute  DOMString            maxWidth;
           attribute  DOMString            minHeight;
           attribute  DOMString            minWidth;
           attribute  DOMString            orphans;
           attribute  DOMString            outline;
           attribute  DOMString            outlineColor;
           attribute  DOMString            outlineStyle;
           attribute  DOMString            outlineWidth;
           attribute  DOMString            overflow;
           attribute  DOMString            padding;
           attribute  DOMString            paddingTop;
           attribute  DOMString            paddingRight;
           attribute  DOMString            paddingBottom;
           attribute  DOMString            paddingLeft;
           attribute  DOMString            page;
           attribute  DOMString            pageBreakAfter;
           attribute  DOMString            pageBreakBefore;
           attribute  DOMString            pageBreakInside;
           attribute  DOMString            pause;
           attribute  DOMString            pauseAfter;
           attribute  DOMString            pauseBefore;
           attribute  DOMString            pitch;
           attribute  DOMString            pitchRange;
           attribute  DOMString            playDuring;
           attribute  DOMString            position;
           attribute  DOMString            quotes;
           attribute  DOMString            richness;
           attribute  DOMString            right;
           attribute  DOMString            size;
           attribute  DOMString            speak;
           attribute  DOMString            speakHeader;
           attribute  DOMString            speakNumeral;
           attribute  DOMString            speakPunctuation;
           attribute  DOMString            speechRate;
           attribute  DOMString            stress;
           attribute  DOMString            tableLayout;
           attribute  DOMString            textAlign;
           attribute  DOMString            textDecoration;
           attribute  DOMString            textIndent;
           attribute  DOMString            textShadow;
           attribute  DOMString            textTransform;
           attribute  DOMString            top;
           attribute  DOMString            unicodeBidi;
           attribute  DOMString            verticalAlign;
           attribute  DOMString            visibility;
           attribute  DOMString            voiceFamily;
           attribute  DOMString            volume;
           attribute  DOMString            whiteSpace;
           attribute  DOMString            widows;
           attribute  DOMString            width;
           attribute  DOMString            wordSpacing;
           attribute  DOMString            zIndex;
};

Attributes
azimuth
See the azimuth property definition in CSS2.
background
See the background property definition in CSS2.
backgroundAttachment
See the background-attachment property definition in CSS2.
backgroundColor
See the background-color property definition in CSS2.
backgroundImage
See the background-image property definition in CSS2.
backgroundPosition
See the background-position property definition in CSS2.
backgroundRepeat
See the background-repeat property definition in CSS2.
border
See the border property definition in CSS2.
borderCollapse
See the border-collapse property definition in CSS2.
borderColor
See the border-color property definition in CSS2.
borderSpacing
See the border-spacing property definition in CSS2.
borderStyle
See the border-style property definition in CSS2.
borderTop
See the border-top property definition in CSS2.
borderRight
See the border-right property definition in CSS2.
borderBottom
See the border-bottom property definition in CSS2.
borderLeft
See the border-left property definition in CSS2.
borderTopColor
See the border-top-color property definition in CSS2.
borderRightColor
See the border-right-color property definition in CSS2.
borderBottomColor
See the border-bottom-color property definition in CSS2.
borderLeftColor
See the border-left-color property definition in CSS2.
borderTopStyle
See the border-top-style property definition in CSS2.
borderRightStyle
See the border-right-style property definition in CSS2.
borderBottomStyle
See the border-bottom-style property definition in CSS2.
borderLeftStyle
See the border-left-style property definition in CSS2.
borderTopWidth
See the border-top-width property definition in CSS2.
borderRightWidth
See the border-right-width property definition in CSS2.
borderBottomWidth
See the border-bottom-width property definition in CSS2.
borderLeftWidth
See the border-left-width property definition in CSS2.
borderWidth
See the border-width property definition in CSS2.
bottom
See the bottom property definition in CSS2.
captionSide
See the caption-side property definition in CSS2.
clear
See the clear property definition in CSS2.
clip
See the clip property definition in CSS2.
color
See the color property definition in CSS2.
content
See the content property definition in CSS2.
counterIncrement
See the counter-increment property definition in CSS2.
counterReset
See the counter-reset property definition in CSS2.
cue
See the cue property definition in CSS2.
cueAfter
See the cue-after property definition in CSS2.
cueBefore
See the cue-before property definition in CSS2.
cursor
See the cursor property definition in CSS2.
direction
See the direction property definition in CSS2.
display
See the display property definition in CSS2.
elevation
See the elevation property definition in CSS2.
emptyCells
See the empty-cells property definition in CSS2.
cssFloat
See the float property definition in CSS2.
font
See the font property definition in CSS2.
fontFamily
See the font-family property definition in CSS2.
fontSize
See the font-size property definition in CSS2.
fontSizeAdjust
See the font-size-adjust property definition in CSS2.
fontStretch
See the font-stretch property definition in CSS2.
fontStyle
See the font-style property definition in CSS2.
fontVariant
See the font-variant property definition in CSS2.
fontWeight
See the font-weight property definition in CSS2.
height
See the height property definition in CSS2.
left
See the left property definition in CSS2.
letterSpacing
See the letter-spacing property definition in CSS2.
lineHeight
See the line-height property definition in CSS2.
listStyle
See the list-style property definition in CSS2.
listStyleImage
See the list-style-image property definition in CSS2.
listStylePosition
See the list-style-position property definition in CSS2.
listStyleType
See the list-style-type property definition in CSS2.
margin
See the margin property definition in CSS2.
marginTop
See the margin-top property definition in CSS2.
marginRight
See the margin-right property definition in CSS2.
marginBottom
See the margin-bottom property definition in CSS2.
marginLeft
See the margin-left property definition in CSS2.
markerOffset
See the marker-offset property definition in CSS2.
marks
See the marks property definition in CSS2.
maxHeight
See the max-height property definition in CSS2.
maxWidth
See the max-width property definition in CSS2.
minHeight
See the min-height property definition in CSS2.
minWidth
See the min-width property definition in CSS2.
orphans
See the orphans property definition in CSS2.
outline
See the outline property definition in CSS2.
outlineColor
See the outline-color property definition in CSS2.
outlineStyle
See the outline-style property definition in CSS2.
outlineWidth
See the outline-width property definition in CSS2.
overflow
See the overflow property definition in CSS2.
padding
See the padding property definition in CSS2.
paddingTop
See the padding-top property definition in CSS2.
paddingRight
See the padding-right property definition in CSS2.
paddingBottom
See the padding-bottom property definition in CSS2.
paddingLeft
See the padding-left property definition in CSS2.
page
See the page property definition in CSS2.
pageBreakAfter
See the page-break-after property definition in CSS2.
pageBreakBefore
See the page-break-before property definition in CSS2.
pageBreakInside
See the page-break-inside property definition in CSS2.
pause
See the pause property definition in CSS2.
pauseAfter
See the pause-after property definition in CSS2.
pauseBefore
See the pause-before property definition in CSS2.
pitch
See the pitch property definition in CSS2.
pitchRange
See the pitch-range property definition in CSS2.
playDuring
See the play-during property definition in CSS2.
position
See the position property definition in CSS2.
quotes
See the quotes property definition in CSS2.
richness
See the richness property definition in CSS2.
right
See the right property definition in CSS2.
size
See the size property definition in CSS2.
speak
See the speak property definition in CSS2.
speakHeader
See the speak-header property definition in CSS2.
speakNumeral
See the speak-numeral property definition in CSS2.
speakPunctuation
See the speak-punctuation property definition in CSS2.
speechRate
See the speech-rate property definition in CSS2.
stress
See the stress property definition in CSS2.
tableLayout
See the table-layout property definition in CSS2.
textAlign
See the text-align property definition in CSS2.
textDecoration
See the text-decoration property definition in CSS2.
textIndent
See the text-indent property definition in CSS2.
textShadow
See the text-shadow property definition in CSS2.
textTransform
See the text-transform property definition in CSS2.
top
See the top property definition in CSS2.
unicodeBidi
See the unicode-bidi property definition in CSS2.
verticalAlign
See the vertical-align property definition in CSS2.
visibility
See the visibility property definition in CSS2.
voiceFamily
See the voice-family property definition in CSS2.
volume
See the volume property definition in CSS2.
whiteSpace
See the white-space property definition in CSS2.
widows
See the widows property definition in CSS2.
width
See the width property definition in CSS2.
wordSpacing
See the word-spacing property definition in CSS2.
zIndex
See the z-index property definition in CSS2.

1.5. Extensions to Level 1 Interfaces

(ED: This section will dissipate into other sections of the Level 2 DOM as they develop. These extensions are placed here until those other sections are prepared. )

1.5.1. Document style sheets

A collection of all stylesheets linked into or embedded in the document is exposed through the styleSheets attribute. In HTML, this collection contains both external style sheets, included via the LINK element, and inline style sheets, included via STYLE elements. In XML, this collection contains all external style sheets included via a style sheet processing instruction .



    interface  Document2 : Document {
      readonly attribute StyleSheetCollection styleSheets;
    };
       

1.5.2. HTMLElement inline style

Inline style information attached to HTML elements is exposed through the style attribute. This represents the contents of the STYLE attribute for HTML elements.



    interface HTMLElement2 : HTMLElement {
      readonly attribute CSSStyleDeclaration style;
    };
        

1.5.3. HTMLStyleElement style sheet

The style sheet associated with an HTML STYLE element is accessible via the styleSheet attribute.



    interface HTMLStyleElement2 : HTMLStyleElement {
      readonly attribute StyleSheet styleSheet;
    };
        

1.5.4. HTMLLinkElement style sheet

The styleSheet associated with an HTML LINK element with a REL of "stylesheet" or "alternate stylesheet" is not accessible directly. This is because LINK elements are not used purely as a stylesheet linking mechanism. The styleSheet property on LINK elements with other relationships would be incongruous.

1.6. Unresolved Issues

  1. The DOM Working Group is considering a way to represent comments that exist within a CSS style sheet. Our expectation is that absolute position of comments may not be maintained, but relative position (with respect to CSS rules and CSS properties) and the actual contents of the comment will be.
  2. The DOM Working Group is considering a mechanism to allow users to retrieve the cascaded, computed and actual style for a specific element.
  3. The DOM Working Group is considering a mechanism to allow users to change the cascaded style for a specific element. This would allow the style of an element to be changed without adding rules to existing style sheets or changing the style attribute of an element. In this way, the style for an element could be changed without participating in the cascade.