DOM

DOM

Source

StaticRange

In all current engines.

Firefox69+Safari10.1+Chrome60+ Opera47+Edge79+ Edge (Legacy)18IENone Firefox for AndroidNoneiOS Safari10.3+Chrome for Android60+Android WebView60+Samsung Internet8.0+Opera Mobile44+


dictionary StaticRangeInit { required Node startContainer; required unsigned long startOffset; required Node endContainer; required unsigned long endOffset;
}; [Exposed=Window]
interface StaticRange : );
};
staticRange = new StaticRange(init)

Returns a new range object that does not update when the node tree mutates.

StaticRange/StaticRange

Firefox71+Safari13.1+ChromeNone OperaNoneEdgeNone Edge (Legacy)NoneIENone Firefox for AndroidNoneiOS Safari13.4+Chrome for AndroidNoneAndroid WebViewNoneSamsung InternetNoneOpera MobileNone

The new StaticRange(init) constructor steps are:

Range

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+


[Exposed=Window]
interface Range : , ); , ); ); ); ); );  = false); ); ); const , ); [); [); [, ); , ); ); stringifier;
};

Objects implementing the Range interface are known as live ranges.

Algorithms that modify a tree (in particular the insert, remove, replace data, and split algorithms) modify live ranges associated with that tree.

The root of a live range is the root of its start node.

A node node is contained in a live range range if node’s root is range’s root, and (node, 0) is after range’s start, and
(node, node’s length) is before range’s end.

A node is partially contained in a live range if it’s an inclusive ancestor of the live range’s start node but not its end node, or vice versa.

Some facts to better understand these definitions:

range = new Range() Returns a new live range.

Range/Range

In all current engines.

Firefox24+Safari6.1+Chrome29+ Opera16+Edge79+ Edge (Legacy)15+IENone Firefox for Android24+iOS Safari8+Chrome for Android29+Android WebView37+Samsung Internet2.0+Opera Mobile16+

The new Range() constructor steps are
to set this’s start and end to
(current global object’s associated Document, 0).

container = range . commonAncestorContainer Returns the node, furthest away from the document, that is an ancestor of both range’s start node and end node.

Read Next page

Report Page