goog.dom.MultiRangeIterator
Provided By | |
---|---|
Extends | |
All Implemented Interfaces |
|
Subclass of goog.dom.TagIterator that iterates over a DOM range. It adds functions to determine the portion of each text node that is selected.
new MultiRangeIterator( range )
Parameters |
|
---|
Instance Methods
this.__iterator__( opt_keys ) → goog.iter.Iterator<(VALUE|null)>
goog.iter.Iterator<(VALUE|null)>
Returns the Iterator
object itself. This is used to implement
the iterator protocol in JavaScript 1.7
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.clone() → goog.dom.MultiRangeIterator
goog.dom.MultiRangeIterator
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.copyFrom( other ) → void
void
Replace this iterator's values with values from another. The two iterators must be of the same type.
Overrides | |||||
---|---|---|---|---|---|
Parameters |
|
this.equals( other ) → boolean
boolean
Test if two iterators are at the same position - i.e. if the node and tagType is the same. This will still return true if the two iterators are moving in opposite directions or have different constraints.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
| ||||
Returns |
|
this.getEndNode() → (Node|null)
(Node|null)
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getEndTextOffset() → number
number
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getStartNode() → (Node|null)
(Node|null)
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.getStartTextOffset() → number
number
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isEndTag() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isLast() → boolean
boolean
Overrides | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isNonElement() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isStartTag() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.isStarted() → boolean
boolean
Defined by | |||
---|---|---|---|
Parameters | None. | ||
Returns |
|
this.next( opt_value ) → IIterableResult<Node>
IIterableResult<Node>
Move to the next position in the DOM tree.
Overrides | |||||
---|---|---|---|---|---|
Specified by | |||||
Parameters |
| ||||
Returns |
|
this.restartTag() → void
void
Restart the current tag.
this.setPosition( node, opt_tagType, opt_depth ) → void
void
Set the position of the iterator. Overwrite the tree node and the position
type which can be one of the goog.dom.TagWalkType
token types.
Only overwrites the tree depth when the parameter is specified.
Defined by | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
this.skipTag() → void
void
Skip the current tag.
this.splice( ...var_args ) → void
void
Replace the current node with the list of nodes. Reset the iterator so that it visits the first of the nodes next.
Defined by | |||||
---|---|---|---|---|---|
Parameters |
|
Instance Properties
this.constrained → boolean
boolean
Whether the iterator is constrained to the starting node and its children.
this.depth → number
number
The tree depth of this position relative to where the iterator started. The depth is considered to be the tree depth just past the current node, so if an iterator is at position
|
(i.e. the node is the div and the type is START_TAG) its depth will be 1.
this.node → (Node|null)
(Node|null)
The node this position is located on.
this.reversed → boolean
boolean
Whether the node iterator is moving in reverse.
this.tagType → goog.dom.TagWalkType
goog.dom.TagWalkType
The type of this position.