WD-DOM-Level-2-19990719


Appendix E: ECMA Script Language Binding

This appendix contains the complete ECMA Script binding for the Level 2 Document Object Model definitions. The definitions are divided into Core, Namespaces, Stylesheets, CSS, Events, Filters and Iterators, and Range.

E.1: Document Object Model Level 2 Core

Object DocumentType2
DocumentType2 has the all the properties and methods of DocumentType as well as the properties and methods defined below.
The DocumentType2 object has the following properties:
publicID
This property is of type String.
systemID
This property is of type String.
Object DOMImplementation2
DOMImplementation2 has the all the properties and methods of DOMImplementation as well as the properties and methods defined below.
The DOMImplementation2 object has the following methods:
createDocumentType(name, publicID, systemID)
This method returns a DocumentType. The name parameter is of type DOMString. The publicID parameter is of type DOMString. The systemID parameter is of type DOMString.
createDocument(name, doctype)
This method returns a Document. The name parameter is of type DOMString. The doctype parameter is of type DocumentType.
Object Document2
Document2 has the all the properties and methods of Document as well as the properties and methods defined below.
The Document2 object has the following methods:
importNode(importedNode, deep)
This method returns a Node. The importedNode parameter is of type Node. The deep parameter is of type boolean.
Object Node2
Node2 has the all the properties and methods of Node as well as the properties and methods defined below.
The Node2 object has the following methods:
supports(feature, version)
This method returns a boolean. The feature parameter is of type DOMString. The version parameter is of type DOMString.
Object Attr2
Attr2 has the all the properties and methods of Attr as well as the properties and methods defined below.
The Attr2 object has the following properties:
ownerElement
This property is of type Element.
Object HTMLDOMImplementation
HTMLDOMImplementation has the all the properties and methods of DOMImplementation as well as the properties and methods defined below.
The HTMLDOMImplementation object has the following methods:
createHTMLDocument(title)
This method returns a HTMLDocument. The title parameter is of type DOMString.

E.2: Document Object Model Level 2 Namespaces

Object NodeNS
The NodeNS object has the following properties:
namespaceName
This property is of type String.
prefix
This property is of type String.
localName
This property is of type String.
Object DocumentNS
The DocumentNS object has the following methods:
createElementNS(namespaceName, qualifiedName)
This method returns a Element. The namespaceName parameter is of type DOMString. The qualifiedName parameter is of type DOMString.
createAttributeNS(namespaceName, qualifiedName)
This method returns a Attr. The namespaceName parameter is of type DOMString. The qualifiedName parameter is of type DOMString.
getElementsByTagNameNS(namespaceName, localName)
This method returns a NodeList. The namespaceName parameter is of type DOMString. The localName parameter is of type DOMString.
Object ElementNS
The ElementNS object has the following methods:
getAttributeNS(namespaceName, localName)
This method returns a DOMString. The namespaceName parameter is of type DOMString. The localName parameter is of type DOMString.
setAttributeNS(namespaceName, localName, value)
This method returns a void. The namespaceName parameter is of type DOMString. The localName parameter is of type DOMString. The value parameter is of type DOMString.
removeAttributeNS(namespaceName, localName)
This method returns a void. The namespaceName parameter is of type DOMString. The localName parameter is of type DOMString.
getAttributeNodeNS(namespaceName, localName)
This method returns a Attr. The namespaceName parameter is of type DOMString. The localName parameter is of type DOMString.
setAttributeNodeNS(newAttr)
This method returns a Attr. The newAttr parameter is of type Attr.
getElementsByTagNameNS(namespaceName, localName)
This method returns a NodeList. The namespaceName parameter is of type DOMString. The localName parameter is of type DOMString.
Object NodeNS
The NodeNS object has the following properties:
universalName
This property is of type String.
namespaceName
This property is of type String.
prefix
This property is of type String.
localName
This property is of type String.
Object Document changes
The Document changes object has the following methods:
createElement(universalName)
This method returns a Element. The universalName parameter is of type DOMString.
createAttribute(universalName)
This method returns a Attr. The universalName parameter is of type DOMString.
getElementsByTagName(universalName)
This method returns a NodeList. The universalName parameter is of type DOMString.
Object Element changes
The Element changes object has the following methods:
getAttribute(universalName)
This method returns a DOMString. The universalName parameter is of type DOMString.
setAttribute(universalName, value)
This method returns a void. The universalName parameter is of type DOMString. The value parameter is of type DOMString.
removeAttribute(universalName)
This method returns a void. The universalName parameter is of type DOMString.
getAttributeNode(universalName)
This method returns a Attr. The universalName parameter is of type DOMString.
setAttributeNode(newAttr)
This method returns a Attr. The newAttr parameter is of type Attr.
getElementsByTagName(universalName)
This method returns a NodeList. The universalName parameter is of type DOMString.

E.3: Document Object Model Level 2 Stylesheets

Object StyleSheet
The StyleSheet object has the following properties:
type
This property is of type String.
disabled
This property is of type boolean.
ownerNode
This property is of type Node.
parentStyleSheet
This property is of type StyleSheet.
href
This property is of type String.
title
This property is of type String.
media
This property is of type MediaList.
Object StyleSheetList
The StyleSheetList object has the following properties:
length
This property is of type int.
The StyleSheetList object has the following methods:
item(index)
This method returns a StyleSheet. The index parameter is of type unsigned long.
Object MediaList
The MediaList object has the following properties:
cssText
This property is of type String.
length
This property is of type int.
The MediaList object has the following methods:
item(index)
This method returns a DOMString. The index parameter is of type unsigned long.
delete(oldMedium)
This method returns a void. The oldMedium parameter is of type DOMString.
append(newMedium)
This method returns a void. The newMedium parameter is of type DOMString.
Object DocumentStyle
The DocumentStyle object has the following properties:
styleSheets
This property is of type StyleSheetList.

E.4: Document Object Model Level 2 CSS

Object CSSStyleSheet
CSSStyleSheet has the all the properties and methods of StyleSheet as well as the properties and methods defined below.
The CSSStyleSheet object has the following properties:
ownerRule
This property is of type CSSRule.
cssRules
This property is of type CSSRuleList.
The CSSStyleSheet object has the following methods:
insertRule(rule, index)
This method returns a unsigned long. The rule parameter is of type DOMString. The index parameter is of type unsigned long.
deleteRule(index)
This method returns a void. The index parameter is of type unsigned long.
Object CSSRuleList
The CSSRuleList object has the following properties:
length
This property is of type int.
The CSSRuleList object has the following methods:
item(index)
This method returns a CSSRule. The index parameter is of type unsigned long.
Object CSSRule
The CSSRule object has the following properties:
type
This property is of type short.
cssText
This property is of type String.
parentStyleSheet
This property is of type CSSStyleSheet.
parentRule
This property is of type CSSRule.
Object CSSStyleRule
CSSStyleRule has the all the properties and methods of CSSRule as well as the properties and methods defined below.
The CSSStyleRule object has the following properties:
selectorText
This property is of type String.
style
This property is of type CSSStyleDeclaration.
Object CSSMediaRule
CSSMediaRule has the all the properties and methods of CSSRule as well as the properties and methods defined below.
The CSSMediaRule object has the following properties:
media
This property is of type MediaList.
cssRules
This property is of type CSSRuleList.
The CSSMediaRule object has the following methods:
insertRule(rule, index)
This method returns a unsigned long. The rule parameter is of type DOMString. The index parameter is of type unsigned long.
deleteRule(index)
This method returns a void. The index parameter is of type unsigned long.
Object CSSFontFaceRule
CSSFontFaceRule has the all the properties and methods of CSSRule as well as the properties and methods defined below.
The CSSFontFaceRule object has the following properties:
style
This property is of type CSSStyleDeclaration.
Object CSSPageRule
CSSPageRule has the all the properties and methods of CSSRule as well as the properties and methods defined below.
The CSSPageRule object has the following properties:
selectorText
This property is of type String.
style
This property is of type CSSStyleDeclaration.
Object CSSImportRule
CSSImportRule has the all the properties and methods of CSSRule as well as the properties and methods defined below.
The CSSImportRule object has the following properties:
href
This property is of type String.
media
This property is of type MediaList.
styleSheet
This property is of type CSSStyleSheet.
Object CSSCharsetRule
CSSCharsetRule has the all the properties and methods of CSSRule as well as the properties and methods defined below.
The CSSCharsetRule object has the following properties:
encoding
This property is of type String.
Object CSSUnknownRule
CSSUnknownRule has the all the properties and methods of CSSRule as well as the properties and methods defined below.
Object CSSStyleDeclaration
The CSSStyleDeclaration object has the following properties:
cssText
This property is of type String.
length
This property is of type int.
parentRule
This property is of type CSSRule.
The CSSStyleDeclaration object has the following methods:
getPropertyValue(propertyName)
This method returns a DOMString. The propertyName parameter is of type DOMString.
getPropertyCSSValue(propertyName)
This method returns a CSSValue. The propertyName parameter is of type DOMString.
removeProperty(propertyName)
This method returns a DOMString. The propertyName parameter is of type DOMString.
getPropertyPriority(propertyName)
This method returns a DOMString. The propertyName parameter is of type DOMString.
setProperty(propertyName, value, priority)
This method returns a void. The propertyName parameter is of type DOMString. The value parameter is of type DOMString. The priority parameter is of type DOMString.
item(index)
This method returns a DOMString. The index parameter is of type unsigned long.
Object CSSValue
The CSSValue object has the following properties:
cssText
This property is of type String.
valueType
This property is of type short.
Object CSSPrimitiveValue
CSSPrimitiveValue has the all the properties and methods of CSSValue as well as the properties and methods defined below.
The CSSPrimitiveValue object has the following properties:
primitiveType
This property is of type short.
The CSSPrimitiveValue object has the following methods:
setFloatValue(unitType, floatValue)
This method returns a void. The unitType parameter is of type unsigned short. The floatValue parameter is of type float.
getFloatValue(unitType)
This method returns a float. The unitType parameter is of type unsigned short.
setStringValue(stringType, stringValue)
This method returns a void. The stringType parameter is of type unsigned short. The stringValue parameter is of type DOMString.
getStringValue()
This method returns a DOMString.
getCounterValue()
This method returns a Counter.
getRectValue()
This method returns a Rect.
getRGBColorValue()
This method returns a RGBColor.
Object CSSValueList
CSSValueList has the all the properties and methods of CSSValue as well as the properties and methods defined below.
The CSSValueList object has the following properties:
length
This property is of type int.
The CSSValueList object has the following methods:
item(index)
This method returns a CSSValue. The index parameter is of type unsigned long.
Object RGBColor
The RGBColor object has the following properties:
red
This property is of type CSSValue.
green
This property is of type CSSValue.
blue
This property is of type CSSValue.
Object Rect
The Rect object has the following properties:
top
This property is of type CSSValue.
right
This property is of type CSSValue.
bottom
This property is of type CSSValue.
left
This property is of type CSSValue.
Object Counter
The Counter object has the following properties:
identifier
This property is of type String.
listStyle
This property is of type String.
separator
This property is of type String.
Object CSS2Azimuth
CSS2Azimuth has the all the properties and methods of CSSValue as well as the properties and methods defined below.
The CSS2Azimuth object has the following properties:
azimuthType
This property is of type short.
identifier
This property is of type String.
behind
This property is of type boolean.
The CSS2Azimuth object has the following methods:
setAngleValue(unitType, floatValue)
This method returns a void. The unitType parameter is of type unsigned short. The floatValue parameter is of type float.
getAngleValue(unitType)
This method returns a float. The unitType parameter is of type unsigned short.
setIdentifier(identifier, behind)
This method returns a void. The identifier parameter is of type DOMString. The behind parameter is of type boolean.
Object CSS2BackgroundPosition
CSS2BackgroundPosition has the all the properties and methods of CSSValue as well as the properties and methods defined below.
The CSS2BackgroundPosition object has the following properties:
horizontalType
This property is of type short.
verticalType
This property is of type short.
horizontalIdentifier
This property is of type String.
verticalIdentifier
This property is of type String.
The CSS2BackgroundPosition object has the following methods:
getHorizontalPosition(horizontalType)
This method returns a float. The horizontalType parameter is of type float.
getVerticalPosition(verticalType)
This method returns a float. The verticalType parameter is of type float.
setHorizontalPosition(horizontalType, value)
This method returns a void. The horizontalType parameter is of type unsigned short. The value parameter is of type float.
setVerticalPosition(verticalType, value)
This method returns a void. The verticalType parameter is of type unsigned short. The value parameter is of type float.
setPositionIdentifier(horizontalIdentifier, verticalIdentifier)
This method returns a void. The horizontalIdentifier parameter is of type DOMString. The verticalIdentifier parameter is of type DOMString.
Object CSS2BorderSpacing
CSS2BorderSpacing has the all the properties and methods of CSSValue as well as the properties and methods defined below.
The CSS2BorderSpacing object has the following properties:
horizontalType
This property is of type short.
verticalType
This property is of type short.
The CSS2BorderSpacing object has the following methods:
getHorizontalSpacing(horizontalType)
This method returns a float. The horizontalType parameter is of type float.
getVerticalSpacing(verticalType)
This method returns a float. The verticalType parameter is of type float.
setHorizontalSpacing(horizontalType, value)
This method returns a void. The horizontalType parameter is of type unsigned short. The value parameter is of type float.
setVerticalSpacing(verticalType, value)
This method returns a void. The verticalType parameter is of type unsigned short. The value parameter is of type float.
setInherit()()
This method returns a void.
Object CSS2CounterReset
The CSS2CounterReset object has the following properties:
identifier
This property is of type String.
reset
This property is of type short.
Object CSS2CounterIncrement
The CSS2CounterIncrement object has the following properties:
identifier
This property is of type String.
increment
This property is of type short.
Object CSS2Cursor
CSS2Cursor has the all the properties and methods of CSSValue as well as the properties and methods defined below.
The CSS2Cursor object has the following properties:
cursorType
This property is of type short.
uris
This property is of type CSSValueList.
predefinedCursor
This property is of type String.
Object CSS2PlayDuring
CSS2PlayDuring has the all the properties and methods of CSSValue as well as the properties and methods defined below.
The CSS2PlayDuring object has the following properties:
playDuringType
This property is of type short.
playDuringIdentifier
This property is of type String.
uri
This property is of type String.
mix
This property is of type boolean.
repeat
This property is of type boolean.
Object CSS2TextShadow
The CSS2TextShadow object has the following properties:
color
This property is of type CSSValue.
horizontal
This property is of type CSSValue.
vertical
This property is of type CSSValue.
blur
This property is of type CSSValue.
Object CSS2FontFaceSrc
The CSS2FontFaceSrc object has the following properties:
uri
This property is of type String.
format
This property is of type CSSValueList.
fontFaceName
This property is of type String.
Object CSS2FontFaceWidths
The CSS2FontFaceWidths object has the following properties:
urange
This property is of type String.
numbers
This property is of type CSSValueList.
Object CSS2PageSize
CSS2PageSize has the all the properties and methods of CSSValue as well as the properties and methods defined below.
The CSS2PageSize object has the following properties:
widthType
This property is of type short.
heightType
This property is of type short.
identifier
This property is of type String.
The CSS2PageSize object has the following methods:
getWidth(widthType)
This method returns a float. The widthType parameter is of type float.
getHeightSize(heightType)
This method returns a float. The heightType parameter is of type float.
setWidthSize(widthType, value)
This method returns a void. The widthType parameter is of type unsigned short. The value parameter is of type float.
setHeightSize(heightType, value)
This method returns a void. The heightType parameter is of type unsigned short. The value parameter is of type float.
setIdentifier(identifier)
This method returns a void. The identifier parameter is of type DOMString.
Object CSS2Properties
The CSS2Properties object has the following properties:
azimuth
This property is of type String.
background
This property is of type String.
backgroundAttachment
This property is of type String.
backgroundColor
This property is of type String.
backgroundImage
This property is of type String.
backgroundPosition
This property is of type String.
backgroundRepeat
This property is of type String.
border
This property is of type String.
borderCollapse
This property is of type String.
borderColor
This property is of type String.
borderSpacing
This property is of type String.
borderStyle
This property is of type String.
borderTop
This property is of type String.
borderRight
This property is of type String.
borderBottom
This property is of type String.
borderLeft
This property is of type String.
borderTopColor
This property is of type String.
borderRightColor
This property is of type String.
borderBottomColor
This property is of type String.
borderLeftColor
This property is of type String.
borderTopStyle
This property is of type String.
borderRightStyle
This property is of type String.
borderBottomStyle
This property is of type String.
borderLeftStyle
This property is of type String.
borderTopWidth
This property is of type String.
borderRightWidth
This property is of type String.
borderBottomWidth
This property is of type String.
borderLeftWidth
This property is of type String.
borderWidth
This property is of type String.
bottom
This property is of type String.
captionSide
This property is of type String.
clear
This property is of type String.
clip
This property is of type String.
color
This property is of type String.
content
This property is of type String.
counterIncrement
This property is of type String.
counterReset
This property is of type String.
cue
This property is of type String.
cueAfter
This property is of type String.
cueBefore
This property is of type String.
cursor
This property is of type String.
direction
This property is of type String.
display
This property is of type String.
elevation
This property is of type String.
emptyCells
This property is of type String.
cssFloat
This property is of type String.
font
This property is of type String.
fontFamily
This property is of type String.
fontSize
This property is of type String.
fontSizeAdjust
This property is of type String.
fontStretch
This property is of type String.
fontStyle
This property is of type String.
fontVariant
This property is of type String.
fontWeight
This property is of type String.
height
This property is of type String.
left
This property is of type String.
letterSpacing
This property is of type String.
lineHeight
This property is of type String.
listStyle
This property is of type String.
listStyleImage
This property is of type String.
listStylePosition
This property is of type String.
listStyleType
This property is of type String.
margin
This property is of type String.
marginTop
This property is of type String.
marginRight
This property is of type String.
marginBottom
This property is of type String.
marginLeft
This property is of type String.
markerOffset
This property is of type String.
marks
This property is of type String.
maxHeight
This property is of type String.
maxWidth
This property is of type String.
minHeight
This property is of type String.
minWidth
This property is of type String.
orphans
This property is of type String.
outline
This property is of type String.
outlineColor
This property is of type String.
outlineStyle
This property is of type String.
outlineWidth
This property is of type String.
overflow
This property is of type String.
padding
This property is of type String.
paddingTop
This property is of type String.
paddingRight
This property is of type String.
paddingBottom
This property is of type String.
paddingLeft
This property is of type String.
page
This property is of type String.
pageBreakAfter
This property is of type String.
pageBreakBefore
This property is of type String.
pageBreakInside
This property is of type String.
pause
This property is of type String.
pauseAfter
This property is of type String.
pauseBefore
This property is of type String.
pitch
This property is of type String.
pitchRange
This property is of type String.
playDuring
This property is of type String.
position
This property is of type String.
quotes
This property is of type String.
richness
This property is of type String.
right
This property is of type String.
size
This property is of type String.
speak
This property is of type String.
speakHeader
This property is of type String.
speakNumeral
This property is of type String.
speakPunctuation
This property is of type String.
speechRate
This property is of type String.
stress
This property is of type String.
tableLayout
This property is of type String.
textAlign
This property is of type String.
textDecoration
This property is of type String.
textIndent
This property is of type String.
textShadow
This property is of type String.
textTransform
This property is of type String.
top
This property is of type String.
unicodeBidi
This property is of type String.
verticalAlign
This property is of type String.
visibility
This property is of type String.
voiceFamily
This property is of type String.
volume
This property is of type String.
whiteSpace
This property is of type String.
widows
This property is of type String.
width
This property is of type String.
wordSpacing
This property is of type String.
zIndex
This property is of type String.

E.5: Document Object Model Level 2 Events

Object EventTarget
The EventTarget object has the following methods:
addEventListener(type, listener, useCapture)
This method returns a void. The type parameter is of type DOMString. The listener parameter is of type EventListener. The useCapture parameter is of type boolean.
removeEventListener(type, listener, useCapture)
This method returns a void. The type parameter is of type DOMString. The listener parameter is of type EventListener. The useCapture parameter is of type boolean.
Object EventListener
The EventListener object has the following methods:
handleEvent(event)
This method returns a void. The event parameter is of type Event.
Object Event
The Event object has the following properties:
type
This property is of type String.
target
This property is of type Node.
currentNode
This property is of type Node.
eventPhase
This property is of type short.
The Event object has the following methods:
preventBubble()
This method returns a void.
preventCapture()
This method returns a void.
preventDefault()
This method returns a void.
Object UIEvent
UIEvent has the all the properties and methods of Event as well as the properties and methods defined below.
The UIEvent object has the following properties:
screenX
This property is of type long.
screenY
This property is of type long.
clientX
This property is of type long.
clientY
This property is of type long.
ctrlKey
This property is of type boolean.
shiftKey
This property is of type boolean.
altKey
This property is of type boolean.
metaKey
This property is of type boolean.
keyCode
This property is of type int.
charCode
This property is of type int.
button
This property is of type short.
clickCount
This property is of type short.
Object MutationEvent
MutationEvent has the all the properties and methods of Event as well as the properties and methods defined below.
The MutationEvent object has the following properties:
relatedNode
This property is of type Node.
prevValue
This property is of type String.
newValue
This property is of type String.
attrName
This property is of type String.

E.6: Document Object Model Level 2 Filters and Iterators

Object NodeIterator
The NodeIterator object has the following properties:
whatToShow
This property is of type long.
filter
This property is of type NodeFilter.
The NodeIterator object has the following methods:
nextNode()
This method returns a Node.
previousNode()
This method returns a Node.
Object NodeFilter
The NodeFilter object has the following methods:
acceptNode(n)
This method returns a short. The n parameter is of type Node.
Object TreeWalker
The TreeWalker object has the following properties:
whatToShow
This property is of type long.
filter
This property is of type NodeFilter.
The TreeWalker object has the following methods:
current()
This method returns a Node.
parentNode()
This method returns a Node.
firstChild()
This method returns a Node.
lastChild()
This method returns a Node.
previousSibling()
This method returns a Node.
nextSibling()
This method returns a Node.
Object DocumentIF
The DocumentIF object has the following methods:
createNodeIterator(root, whatToShow, filter)
This method returns a short. The root parameter is of type Node. The whatToShow parameter is of type short. The filter parameter is of type NodeFilter.

E.7: Document Object Model Level 2 Range

Object Range
The Range object has the following properties:
startContainer
This property is of type Node.
startOffset
This property is of type long.
endContainer
This property is of type Node.
endOffset
This property is of type long.
isCollapsed
This property is of type boolean.
commonAncestorContainer
This property is of type Node.
The Range object has the following methods:
setStart(node, offset)
This method returns a void. The node parameter is of type Node. The offset parameter is of type long.
setEnd(node, offset)
This method returns a void. The node parameter is of type Node. The offset parameter is of type long.
setStartBefore(node)
This method returns a void. The node parameter is of type Node.
setStartAfter(node)
This method returns a void. The node parameter is of type Node.
setEndBefore(node)
This method returns a void. The node parameter is of type Node.
setEndAfter(node)
This method returns a void. The node parameter is of type Node.
collapse(toStart)
This method returns a void. The toStart parameter is of type boolean.
selectNode(node)
This method returns a void. The node parameter is of type Node.
selectNodeContents(node)
This method returns a void. The node parameter is of type Node.
compareEndPoints(how, sourceRange)
This method returns a short. The how parameter is of type CompareHow. The sourceRange parameter is of type Range.
deleteContents()
This method returns a void.
extractContents()
This method returns a DocumentFragment.
cloneContents()
This method returns a DocumentFragment.
insertNode(node)
This method returns a void. The node parameter is of type Node.
surroundContents(node)
This method returns a void. The node parameter is of type Node.
cloneRange()
This method returns a Range.
toString()
This method returns a DOMString.