|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--InsertionPoint
Defined in core.js
Field Summary | |
Integer |
NEXT
Constant indicating movement toward the end of the document. |
Integer |
PREVIOUS
Constant indicating movement toward the beginning of the document. |
Constructor Summary | |
InsertionPoint
(<Node> node, <Integer> offset)
An insertion point is the pair of either a) a text node and an offset within the text, or b) an element and an offset within the childNodes list. |
Method Summary | |
Void
|
extend()
Extends the selection to the IP. |
Node
|
getNode()
Gets the current node. |
Integer
|
getOffset()
Gets the offset in the current node. |
Void
|
next()
Sets the node and offset to the next insertion point. |
Void
|
previous()
Sets the node and offset to the previous insertion point. |
Void
|
seek(<Integer> direction)
Sets the node and offset to the next insertion point. |
Object
|
seekNode(direction)
|
Void
|
select()
Collapses the selection to the current IP. |
Field Detail |
Integer NEXT
Integer PREVIOUS
Constructor Detail |
InsertionPoint(<Node> node, <Integer> offset)
node
-
offset
- The offset within the node.
Method Detail |
Void extend()
Node getNode()
Integer getOffset()
Void next()
Void previous()
Void seek(<Integer> direction)
If the offset is at the end of the node, then the next appropriate ndoe is used.
If the node is an element, then the method increments the offset. If the new node has an insertion point, that new IP is used. In this way the method digs down into the child nodes.
If the node is a text node, then we have to worry about the XML white space rules. We want to treat adjacent whitespace as a single character. So we measure the length of the whitespace after the offset (if any). Then "moveBy" is set based on the length of the result and the CSS white-space mode. If the length takes the offset to the end of the node, seekNode is called.
direction
- Can be NEXT or PREVIOUS.
Object seekNode(direction)
Void select()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |