Home

# Class goog.dom.browserrange.IeRange

The constructor for IE specific browser ranges.

extends goog.dom.browserrange.AbstractRange

Instance Method Summary
| `clearCachedValues_()` Clears the cached values for containers.
| `clone() ⇒ ?goog.dom.browserrange.IeRange`
| `collapse(boolean toStart)` Collapses the range to one of its boundary points.
| `compareBrowserRangeEndpoints((Range|TextRange|null) range, ?goog.dom.RangeEndpoint thisEndpoint, ?goog.dom.RangeEndpoint otherEndpoint) ⇒ number` Compares one endpoint of this range with the endpoint of another browser native range object.
| `compareNodeEndpoints_(?Node node, ?goog.dom.RangeEndpoint thisEndpoint, ?goog.dom.RangeEndpoint otherEndpoint) ⇒ number` Compares one endpoint of this range with the endpoint of a node. For internal methods, we should prefer this method to containsNode. containsNode has a lot of false negatives when we're dealing with {@code } tags.
| `findDeepestContainer_(?Node node) ⇒ ?Node` Helper method to find the deepest parent for this range, starting the search from {@code node}, which must contain the range.
| `getBrowserRange() ⇒ (Range|TextRange|null)` Returns the browser native implementation of the range. Please refrain from using this function - if you find you need the range please add wrappers for the functionality you need rather than just using the native range.
| `getContainer() ⇒ ?Node` Returns the deepest node in the tree that contains the entire range.
| `getEndNode() ⇒ ?Node` Returns the node the range ends in.
| `getEndOffset() ⇒ number` Returns the offset into the node the range ends in.
| `getEndpointNode_(?goog.dom.RangeEndpoint endpoint, ?Node= opt_node) ⇒ ?Node` Recurses to find the correct node for the given endpoint.
| `getOffset_(?goog.dom.RangeEndpoint endpoint, ?Node= opt_container) ⇒ number` Returns the offset into the start/end container.
| `getStartNode() ⇒ ?Node` Returns the node the range starts in.
| `getStartOffset() ⇒ number` Returns the offset into the node the range starts in.
| `getText() ⇒ string`
| `getValidHtml() ⇒ string` Returns valid HTML for this range. This is fast on IE, and semi-fast on other browsers.
| `insertNode(?Node node, boolean before) ⇒ ?Node` Inserts a node before (or after) the range. The range may be disrupted beyond recovery because of the way this splits nodes.
| `isCollapsed() ⇒ boolean` Tests if the selection is collapsed - i.e. is just a caret.
| `isRangeInDocument() ⇒ boolean` Tests whether this range is valid (i.e. whether its endpoints are still in the document). A range becomes invalid when, after this object was created, either one or both of its endpoints are removed from the document. Use of an invalid range can lead to runtime errors, particularly in IE.
| `removeContents()` Removes the contents of the range from the document. As a side effect, the selection will be collapsed. The behavior of content removal is normalized across browsers. For instance, IE sometimes creates extra text nodes that a W3C browser does not. That behavior is corrected for.
| `select(boolean= opt_reverse)` Set this range as the selection in its window.
| `surroundContents(?Element element) ⇒ ?Element` Surrounds the text range with the specified element (on Mozilla) or with a clone of the specified element (on IE). Returns a reference to the surrounding element if the operation was successful; returns null if the operation failed.
| `surroundWithNodes(?Element startNode, ?Element endNode)` Surrounds this range with the two given nodes. The range may be disrupted beyond recovery because of the way this splits nodes.

Static Method Summary
| `createFromNodeContents(?Node node) ⇒ ?goog.dom.browserrange.IeRange` Create a range object that selects the given node's text.
| `createFromNodes(?Node startNode, number startOffset, ?Node endNode, number endOffset) ⇒ ?goog.dom.browserrange.AbstractRange` Static method that returns the proper type of browser range.
| `getBrowserRangeForNode_(?Node node) ⇒ ?TextRange` Returns a browser range spanning the given node's contents.
| `getBrowserRangeForNodes_(?Node startNode, number startOffset, ?Node endNode, number endOffset) ⇒ ?TextRange` Returns a browser range spanning the given nodes.
| `getDomHelper_(?TextRange range) ⇒ ?goog.dom.DomHelper`
| `getNodeText_(?Node node) ⇒ string` Returns the text of the given node. Uses IE specific properties.
| `insertNode_(?TextRange clone, ?Node node, boolean before, ?goog.dom.DomHelper= opt_domHelper) ⇒ ?Node` Internal handler for inserting a node.
| `pasteElement_(?TextRange range, ?Element element, ?goog.dom.DomHelper= opt_domHelper) ⇒ ?Element` Pastes the given element into the given range, returning the resulting element.