Methods Summary |
---|
public org.w3c.dom.DocumentFragment | cloneContents()Duplicates the contents of a Range
|
public org.w3c.dom.ranges.Range | cloneRange()Produces a new Range whose boundary-points are equal to the
boundary-points of the Range.
|
public void | collapse(boolean toStart)Collapse a Range onto one of its boundary-points
|
public short | compareBoundaryPoints(short how, org.w3c.dom.ranges.Range sourceRange)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. Subsequent calls to any methods or attribute getters on this
Range will result in a DOMException being thrown with an
error code of INVALID_STATE_ERR .
|
public org.w3c.dom.DocumentFragment | extractContents()Moves the contents of a Range from the containing document or document
fragment to a new DocumentFragment.
|
public boolean | getCollapsed()TRUE if the Range is collapsed
|
public org.w3c.dom.Node | getCommonAncestorContainer()The deepest common ancestor container of the Range's two
boundary-points.
|
public org.w3c.dom.Node | getEndContainer()Node within which the Range ends
|
public int | getEndOffset()Offset within the ending node of the Range.
|
public org.w3c.dom.Node | getStartContainer()Node within which the Range begins
|
public int | getStartOffset()Offset within the starting node of the Range.
|
public void | insertNode(org.w3c.dom.Node newNode)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.
|
public void | selectNode(org.w3c.dom.Node refNode)Select a node and its contents
|
public void | selectNodeContents(org.w3c.dom.Node refNode)Select the contents within a node
|
public void | setEnd(org.w3c.dom.Node refNode, int offset)Sets the attributes describing the end of a Range.
|
public void | setEndAfter(org.w3c.dom.Node refNode)Sets the end of a Range to be after a node
|
public void | setEndBefore(org.w3c.dom.Node refNode)Sets the end position to be before a node.
|
public void | setStart(org.w3c.dom.Node refNode, int offset)Sets the attributes describing the start of the Range.
|
public void | setStartAfter(org.w3c.dom.Node refNode)Sets the start position to be after a node
|
public void | setStartBefore(org.w3c.dom.Node refNode)Sets the start position to be before a node
|
public void | surroundContents(org.w3c.dom.Node 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 java.lang.String | toString()Returns the contents of a Range as a string. This string contains only
the data characters, not any markup.
|