| Modifier and Type | Field and Description |
|---|---|
| public static final short | END_TO_END
Compare end boundary-point of |
| public static final short | END_TO_START
Compare end boundary-point of |
| public static final short | START_TO_END
Compare start boundary-point of |
| public static final short | START_TO_START
Compare start boundary-point of |
| Modifier and Type | Method and Description |
|---|---|
| public DocumentFragment | Returns: A DocumentFragment that contains content equivalent to this Range.Duplicates the contents of a Range |
| public Range | Returns: The duplicated Range.Produces a new Range whose boundary-points are equal to the boundary-points of the Range. |
| public void | collapse(boolean
If TRUE, collapses the Range onto its start; if FALSE,
collapses it onto its end. toStart)Collapse a Range onto one of its boundary-points |
| public short | Returns: -1, 0 or 1 depending on whether the corresponding boundary-point of the Range is respectively before, equal to, or after the corresponding boundary-point ofsourceRange.A code representing the type of comparison, as defined
above. how, Range The sourceRange)Range on which this current
Range is compared to.Compare the boundary-points of two Ranges in a document. |
| public void | deleteContents()
Removes the contents of a Range from the containing document or document fragment without returning a reference to the removed content. |
| public void | detach()
Called to indicate that the Range is no longer in use and that the implementation may relinquish any resources associated with this Range. |
| public DocumentFragment | Returns: A DocumentFragment containing the extracted contents.Moves the contents of a Range from the containing document or document fragment to a new DocumentFragment. |
| public boolean | |
| public Node | getCommonAncestorContainer()
The deepest common ancestor container of the Range's two boundary-points. |
| public Node | |
| public int | |
| public Node | |
| public int | |
| public void | insertNode(Node
The node to insert at the start of the Range newNode)Inserts a node into the Document or DocumentFragment at the start of the Range. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | surroundContents(Node
The node to surround the contents with. newParent)Reparents the contents of the Range to the given node and inserts the node at the position of the start of the Range. |
| public String |
| END_TO_END | back to summary |
|---|---|
| public static final short END_TO_END Compare end boundary-point of | |
| END_TO_START | back to summary |
|---|---|
| public static final short END_TO_START Compare end boundary-point of | |
| START_TO_END | back to summary |
|---|---|
| public static final short START_TO_END Compare start boundary-point of | |
| START_TO_START | back to summary |
|---|---|
| public static final short START_TO_START Compare start boundary-point of | |
| cloneContents | back to summary |
|---|---|
| public DocumentFragment cloneContents() throws DOMException Duplicates the contents of a Range
| |
| cloneRange | back to summary |
|---|---|
| public Range cloneRange() throws DOMException Produces a new Range whose boundary-points are equal to the boundary-points of the Range.
| |
| collapse | back to summary |
|---|---|
| public void collapse(boolean toStart) throws DOMException Collapse a Range onto one of its boundary-points
| |
| compareBoundaryPoints | back to summary |
|---|---|
| public short compareBoundaryPoints(short how, Range sourceRange) throws DOMException Compare the boundary-points of two Ranges in a document.
| |
| deleteContents | back to summary |
|---|---|
| public void deleteContents() throws DOMException Removes the contents of a Range from the containing document or document fragment without returning a reference to the removed content.
| |
| detach | back to summary |
|---|---|
| public void detach() throws DOMException Called to indicate that the Range is no longer in use and that the
implementation may relinquish any resources associated with this
Range. Subsequent calls to any methods or attribute getters on this
Range will result in a
| |
| extractContents | back to summary |
|---|---|
| public DocumentFragment extractContents() throws DOMException Moves the contents of a Range from the containing document or document fragment to a new DocumentFragment.
| |
| getCollapsed | back to summary |
|---|---|
| public boolean getCollapsed() throws DOMException TRUE if the Range is collapsed
| |
| getCommonAncestorContainer | back to summary |
|---|---|
| public Node getCommonAncestorContainer() throws DOMException The deepest common ancestor container of the Range's two boundary-points.
| |
| getEndContainer | back to summary |
|---|---|
| public Node getEndContainer() throws DOMException Node within which the Range ends
| |
| getEndOffset | back to summary |
|---|---|
| public int getEndOffset() throws DOMException Offset within the ending node of the Range.
| |
| getStartContainer | back to summary |
|---|---|
| public Node getStartContainer() throws DOMException Node within which the Range begins
| |
| getStartOffset | back to summary |
|---|---|
| public int getStartOffset() throws DOMException Offset within the starting node of the Range.
| |
| insertNode | back to summary |
|---|---|
| public void insertNode(Node newNode) throws DOMException, RangeException Inserts a node into the Document or DocumentFragment at the start of the Range. If the container is a Text node, this will be split at the start of the Range (as if the Text node's splitText method was performed at the insertion point) and the insertion will occur between the two resulting Text nodes. Adjacent Text nodes will not be automatically merged. If the node to be inserted is a DocumentFragment node, the children will be inserted rather than the DocumentFragment node itself.
| |
| selectNode | back to summary |
|---|---|
| public void selectNode(Node refNode) throws RangeException, DOMException Select a node and its contents
| |
| selectNodeContents | back to summary |
|---|---|
| public void selectNodeContents(Node refNode) throws RangeException, DOMException Select the contents within a node
| |
| setEnd | back to summary |
|---|---|
| public void setEnd(Node refNode, int offset) throws RangeException, DOMException Sets the attributes describing the end of a Range.
| |
| setEndAfter | back to summary |
|---|---|
| public void setEndAfter(Node refNode) throws RangeException, DOMException Sets the end of a Range to be after a node
| |
| setEndBefore | back to summary |
|---|---|
| public void setEndBefore(Node refNode) throws RangeException, DOMException Sets the end position to be before a node.
| |
| setStart | back to summary |
|---|---|
| public void setStart(Node refNode, int offset) throws RangeException, DOMException Sets the attributes describing the start of the Range.
| |
| setStartAfter | back to summary |
|---|---|
| public void setStartAfter(Node refNode) throws RangeException, DOMException Sets the start position to be after a node
| |
| setStartBefore | back to summary |
|---|---|
| public void setStartBefore(Node refNode) throws RangeException, DOMException Sets the start position to be before a node
| |
| surroundContents | back to summary |
|---|---|
| public void surroundContents(Node newParent) throws DOMException, RangeException Reparents the contents of the Range to the given node and inserts the node at the position of the start of the Range.
| |
| toString | back to summary |
|---|---|
| public String toString() throws DOMException Returns the contents of a Range as a string. This string contains only the data characters, not any markup.
| |