The goog.editor.range.NormalizedCaretRange_ Class

goog.editor.range.NormalizedCaretRange_
> goog.dom.SavedCaretRange
> goog.dom.SavedRange
> goog.Disposable

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.getCaret(start)

Inherited from goog.dom.SavedCaretRange .

Gets carets.

start {boolean}
If true, returns the start caret. Otherwise, get the end caret.
returns {Element}
The start or end caret in the given document.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.removeCarets(opt_range)

Normalizes text nodes whenever carets are removed from the document.

opt_range {goog.dom.AbstractRange=}
A range whose offsets have already been adjusted for caret removal; it will be adjusted and returned if it is also affected by post-removal operations, such as text node normalization.
returns {goog.dom.AbstractRange|undefined}
The adjusted range, if opt_range was provided.

.restore(opt_stayAlive)

Inherited from goog.dom.SavedRange .

Restores the range and by default disposes of the saved copy. Take note: this means the by default SavedRange objects are single use objects.

opt_stayAlive {boolean=}
Whether this SavedRange should stay alive (not be disposed) after restoring the range. Defaults to false (dispose).
returns {goog.dom.AbstractRange}
The restored range.

.setRestorationDocument(doc)

Inherited from goog.dom.SavedCaretRange .

Sets the document where the range will be restored.

doc {!Document}
An HTML document.

.toAbstractRange()

Inherited from goog.dom.SavedCaretRange .

Gets the range that this SavedCaretRage represents, without selecting it or removing the carets from the DOM.

returns {goog.dom.AbstractRange?}
An abstract range.