Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

StaticRange

BaselineWidely available

TheDOMStaticRange interface extendsAbstractRange to provide a method to specify a range of content in the DOM whose contents don't update to reflect changes which occur within the DOM tree.

This interface offers the same set of properties and methods asAbstractRange.

AbstractRange andStaticRange are not available fromweb workers.

AbstractRange StaticRange

Constructor

StaticRange()

Creates a newStaticRange object given options specifying the default values for its properties.

Instance properties

The properties below are inherited from its parent interface,AbstractRange.

StaticRange.collapsedRead only

Returns a Boolean value that istrue if the range's start and end positions are the same, resulting in a range of length 0.

StaticRange.endContainerRead only

Returns the DOMNode which contains the ending point of the range. The offset into the node at which the end position is located is indicated byendOffset.

StaticRange.endOffsetRead only

Returns an integer value indicating the offset into the node given byendContainer at which the last character of the range is found.

StaticRange.startContainerRead only

Returns the DOMNode which contains the starting point of the range (which is in turn identified bystartOffset.

StaticRange.startOffsetRead only

Returns an integer value indicating the offset into the node specified bystartContainer at which the first character of the range is located.

Usage notes

A DOM range specifies a span of content in a document, potentially beginning inside one node (or element) and ending inside another one. Unlike aRange, aStaticRange represents a range which is fixed in time; it does not change to try to keep the same content within it as the document changes. If any changes are made to the DOM, the actual data contained within the range specified by aStaticRange may change. This lets theuser agent avoid a lot of work that is unnecessary if the web app or site doesn't need a live-updating range.

Specifications

Specification
DOM
# interface-staticrange

Browser compatibility

See also

  • Live updating range of content within the DOM:Range
  • AbstractRange, the abstract interface from which all ranges are derived

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp