WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

Range

This object is available to unprivileged JavaScript. It implements the following interfaces:

Constants

short NODE_BEFORE = 0
short NODE_AFTER = 1
short NODE_BEFORE_AND_AFTER = 2
short NODE_INSIDE = 3
short START_TO_START = 0
short START_TO_END = 1
short END_TO_END = 2
short END_TO_START = 3

Properties

readonly boolean collapsed

readonly Node commonAncestorContainer

readonly Node endContainer

readonly PRInt32 endOffset

readonly Node startContainer

The nsIDOMRange interface is an interface to a DOM range object.

For more information on this interface please see http://www.w3.org/TR/DOM-Level-2-Traversal-Range/

readonly PRInt32 startOffset


Methods

DocumentFragment cloneContents ( ) Range cloneRange ( ) void collapse ( boolean toStart ) PRInt16 compareBoundaryPoints ( short how , Range sourceRange ) short compareNode ( Node n ) PRInt16 comparePoint ( Node parent , PRInt32 offset ) DocumentFragment createContextualFragment ( String fragment ) void deleteContents ( ) void detach ( ) DocumentFragment extractContents ( ) void insertNode ( Node newNode ) boolean intersectsNode ( Node n ) boolean isPointInRange ( Node parent , PRInt32 offset ) void nSDetach ( ) void selectNode ( Node refNode ) void selectNodeContents ( Node refNode ) void setEnd ( Node refNode , PRInt32 offset ) void setEndAfter ( Node refNode ) void setEndBefore ( Node refNode ) void setStart ( Node refNode , PRInt32 offset ) void setStartAfter ( Node refNode ) void setStartBefore ( Node refNode ) void surroundContents ( Node newParent ) String toString ( )

DocumentFragment cloneContents ( )


Range cloneRange ( )


void collapse ( boolean toStart )

Arguments:
toStart

PRInt16 compareBoundaryPoints ( short how , Range sourceRange )

Arguments:
how
sourceRange

short compareNode ( Node n )

Arguments:
n

PRInt16 comparePoint ( Node parent , PRInt32 offset )

Arguments:
parent
offset

DocumentFragment createContextualFragment ( String fragment )

Arguments:
fragment

void deleteContents ( )


void detach ( )


DocumentFragment extractContents ( )


void insertNode ( Node newNode )

Arguments:
newNode

boolean intersectsNode ( Node n )

Arguments:
n

boolean isPointInRange ( Node parent , PRInt32 offset )

Arguments:
parent
offset

void nSDetach ( )


void selectNode ( Node refNode )

Arguments:
refNode

void selectNodeContents ( Node refNode )

Arguments:
refNode

void setEnd ( Node refNode , PRInt32 offset )

Arguments:
refNode
offset

void setEndAfter ( Node refNode )

Arguments:
refNode

void setEndBefore ( Node refNode )

Arguments:
refNode

void setStart ( Node refNode , PRInt32 offset )

Arguments:
refNode
offset

void setStartAfter ( Node refNode )

Arguments:
refNode

void setStartBefore ( Node refNode )

Arguments:
refNode

void surroundContents ( Node newParent )

Arguments:
newParent

String toString ( )

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com