Core.Web
DOM
Class Hierarchy:

DOM manipulation utility method namespace.

Class Field Summary
Internal _focusPendingElement
Temporary storage for the element about to be focused (for clients that require 'delayed' focusing).

Class Method Summary
Public addEventListener()
Adds an event listener to an object, using the client's supported event model.
Public createDocument()
Creates a new XML DOM.
Public focusElement()
Focuses the given DOM element.
Internal _focusElementImpl()
Focus element implementation.
Public getChildElementByTagName()
Returns the first immediate child element of parentElement with the specified tag name.
Public getChildElementsByTagName()
Returns an array containing all immediate child element of parentElement with the specified tag name.
Public getEventOffset()
Returns x/y coordinates of mouse relative to the element which fired an event.
Public getEventTarget()
Returns the target of an event, using the client's supported event model.
Public getEventRelatedTarget()
Returns the related target of an event, using the client's supported event model.
Public isAncestorOf()
Determines if ancestorNode is or is an ancestor of descendantNode.
Public preventEventDefault()
Prevents the default action of an event from occurring, using the client's supported event model.
Public removeAllChildren()
Removes all child nodes from the specified DOM node.
Public removeEventListener()
Removes an event listener from an object, using the client's supported event model.
Public removeNode()
Removes the specified DOM node from the DOM tree.
Internal _removeNodeRecursive()
Removes the specified DOM node from the DOM tree in a recursive manner, i.
Public stopEventPropagation()
Stops an event from propagating ("bubbling") to parent nodes in the DOM, using the client's supported event model.

Class Method Detail
addEventListener
Adds an event listener to an object, using the client's supported event model. This method does NOT support method references.
Parameters:
eventSource (Element) - the event source
eventType (String) - the type of event (the 'on' prefix should NOT be included in the event type, i.e., for mouse rollover events, "mouseover" would be specified instead of "onmouseover")
eventListener (Function) - the event listener to be invoked when the event occurs
useCapture (Boolean) - a flag indicating whether the event listener should capture events in the final phase of propagation (only supported by DOM Level 2 event model, not available on Internet Explorer)

createDocument
Creates a new XML DOM.
Parameters:
namespaceUri (String) - the unique URI of the namespace of the root element in the created document (not supported for Internet Explorer 6 clients, null may be specified for all clients)
qualifiedName (String) - the name of the root element of the new document (this element will be created automatically)
Returns:
(Document) the created DOM

focusElement
Focuses the given DOM element. The focus operation may be placed in the scheduler if the browser requires the focus operation to be performed outside of current JavaScript context (i.e., in the case where the element to be focused was just rendered in this context).
Parameters:
element (Element) - the DOM element to focus

_focusElementImpl
Focus element implementation.
Parameters:
element (Element) - the DOM element to focus

getChildElementByTagName
Returns the first immediate child element of parentElement with the specified tag name.
Parameters:
parentElement (Element) - the parent element
tagName - the tag name
Returns:
(Element) the first child element of parentElement with the specified tag name, or null if no elements match

getChildElementsByTagName
Returns an array containing all immediate child element of parentElement with the specified tag name.
Parameters:
parentElement (Element) - the parent element
tagName - the tag name
Returns:
(Array) the child elements

getEventOffset
Returns x/y coordinates of mouse relative to the element which fired an event.
Parameters:
e (Event) - the event
Returns:
object containing 'x' and 'y' properties specifying the numeric pixel coordinates of the mouse relative to the element, with {x: 0, y: 0} indicating its upper-left corner

getEventTarget
Returns the target of an event, using the client's supported event model. On clients which support the W3C DOM Level 2 event specification, the target property of the event is returned. On clients which support only the Internet Explorer event model, the srcElement property of the event is returned.
Parameters:
e (Event) - the event
Returns:
(Element) the target

getEventRelatedTarget
Returns the related target of an event, using the client's supported event model. On clients which support the W3C DOM Level 2 event specification, the relatedTarget property of the event is returned. On clients which support only the Internet Explorer event model, the toElement property of the event is returned.
Parameters:
e (Event) - the event
Returns:
(Element) the target

isAncestorOf
Determines if ancestorNode is or is an ancestor of descendantNode.
Parameters:
ancestorNode (Node) - the potential ancestor node
descendantNode (Node) - the potential descendant node
Returns:
(Boolean) true if ancestorNode is or is an ancestor of descendantNode

preventEventDefault
Prevents the default action of an event from occurring, using the client's supported event model. On clients which support the W3C DOM Level 2 event specification, the preventDefault() method of the event is invoked. On clients which support only the Internet Explorer event model, the 'returnValue' property of the event is set to false.
Parameters:
e (Event) - the event

removeAllChildren
Removes all child nodes from the specified DOM node.
Parameters:
node (Node) - the parent node whose children should be deleted

removeEventListener
Removes an event listener from an object, using the client's supported event model. This method does NOT support method references.
Parameters:
eventSource (Element) - the event source
eventType (String) - the type of event (the 'on' prefix should NOT be included in the event type, i.e., for mouse rollover events, "mouseover" would be specified instead of "onmouseover")
eventListener (Function) - the event listener to be invoked when the event occurs
useCapture (Boolean) - a flag indicating whether the event listener should capture events in the final phase of propagation (only supported by DOM Level 2 event model, not available on Internet Explorer)

removeNode
Removes the specified DOM node from the DOM tree. This method employs a workaround for the QUIRK_PERFORMANCE_LARGE_DOM_REMOVE quirk.
Parameters:
node (Node) - the node which should be deleted

_removeNodeRecursive
Removes the specified DOM node from the DOM tree in a recursive manner, i.e. all descendants of the given node are removed individually. This alleviates slow performance when removing large DOM trees.
Parameters:
node (Node) - the node which should be deleted

stopEventPropagation
Stops an event from propagating ("bubbling") to parent nodes in the DOM, using the client's supported event model. On clients which support the W3C DOM Level 2 event specification, the stopPropagation() method of the event is invoked. On clients which support only the Internet Explorer event model, the 'cancelBubble' property of the event is set to true.
Parameters:
e (Event) - the event