DOM
SourceIn all current engines.
Firefox1+Safari1+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The cloneContents()
method steps are to return the
result of cloning the contents of this.
To insert a node node into a live range range, run these steps:
- If range’s start node is a
ProcessingInstruction
orComment
node, is aText
node whose parent is null, or is node, then throw a "HierarchyRequestError
"DOMException
. - Let referenceNode be null.
- If range’s start node is a
Text
node, set referenceNode to thatText
node. - Otherwise, set referenceNode to the child of start node whose index is start offset, and null if there is no such child.
- Let parent be range’s start node if referenceNode is null, and referenceNode’s parent otherwise.
- Ensure pre-insertion validity of node into parent before referenceNode.
- If range’s start node is a
Text
node, set referenceNode to the result of splitting it with offset range’s start offset. - If node is referenceNode, set referenceNode to its next sibling.
- Let newOffset be parent’s length if referenceNode is null, and referenceNode’s index otherwise.
- Increase newOffset by node’s length if node is a
DocumentFragment
node, and one otherwise. - Pre-insert node into parent before referenceNode.
-
If range is collapsed, then set range’s end to (parent, newOffset).
In all current engines.
Firefox1+Safari1+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The insertNode(node)
method steps are to insert node into this.
In all current engines.
Firefox1+Safari1+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The surroundContents(newParent)
method steps
are:
In all current engines.
Firefox1+Safari1+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The cloneRange()
method steps are to return a new live range with the same start and end as this.
Firefox1–15Safari1+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4–15iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The detach()
method steps are to do nothing. Its functionality (disabling a Range
object) was removed, but the method itself
is preserved for compatibility.
comparePoint(node, offset)
Returns −1 if the point is before the range, 0 if the point is in the range, and 1 if the point is after the range. intersects = range . intersectsNode(node)
Returns whether range intersects node. In all current engines.
Firefox1+Safari3+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)15+IENone Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The isPointInRange(node, offset)
method steps are:
In all current engines.
Firefox1+Safari3+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)17+IENone Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The comparePoint(node, offset)
method steps are:
In all current engines.
Firefox17+Safari3+Chrome1+ Opera12.1+Edge79+ Edge (Legacy)17+IENone Firefox for Android19+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile12.1+
The intersectsNode(node)
method steps are:
- If node’s root is different from this’s root, return false.
- Let parent be node’s parent.
- If parent is null, return true.
- Let offset be node’s index.
- If (parent, offset) is before end and (parent, offset plus 1) is after start, return true.
- Return false.
In all current engines.
Firefox1+Safari1+Chrome1+ Opera9+Edge79+ Edge (Legacy)12+IE9+ Firefox for Android4+iOS Safari1+Chrome for Android18+Android WebView1+Samsung Internet1.0+Opera Mobile10.1+
The stringification behavior must run
these steps:
The createContextualFragment()
, getClientRects()
,
and getBoundingClientRect()
methods are defined in other specifications. [DOM-Parsing] [CSSOM-VIEW]
Read Next page