Lines Matching refs:node
130 Node node;
131 for (node=fStartContainer; node != null;
132 node=node.getParentNode())
134 startV.addElement(node);
137 for (node=fEndContainer; node != null;
138 node=node.getParentNode())
140 endV.addElement(node);
569 // we use relative node depth walking which is usually faster
659 // split text node: results is 3 nodes..
780 Node node = fStartContainer;
791 node=nextNode (node,true); //fEndContainer!=fStartContainer
795 node=node.getFirstChild();
796 if (fStartOffset>0) { //find a first node within a range, specified by fStartOffset
798 while (counter<fStartOffset && node!=null) {
799 node=node.getNextSibling();
803 if (node == null) {
804 node = nextNode(fStartContainer,false);
818 while (node != stopNode) { //look into all kids of the Range
819 if (node == null) break;
820 if (node.getNodeType() == Node.TEXT_NODE
821 || node.getNodeType() == Node.CDATA_SECTION_NODE) {
822 sb.append(node.getNodeValue());
825 node = nextNode(node, true);
853 void signalSplitData(Node node, Node newNode, int offset) {
854 fSplitNode = node;
856 fDocument.splitData(node, newNode, offset);
863 void receiveSplitData(Node node, Node newNode, int offset) {
864 if (node == null || newNode == null) return;
865 if (fSplitNode == node) return;
867 if (node == fStartContainer
874 if (node == fEndContainer
887 void deleteData(CharacterData node, int offset, int count) {
888 fDeleteNode = node;
889 node.deleteData( offset, count);
898 void receiveDeletedText(Node node, int offset, int count) {
899 if (node == null) return;
900 if (fDeleteNode == node) return;
901 if (node == fStartContainer
910 if (node == fEndContainer
925 void insertData(CharacterData node, int index, String insert) {
926 fInsertNode = node;
927 node.insertData( index, insert);
936 void receiveInsertedText(Node node, int index, int len) {
937 if (node == null) return;
938 if (fInsertNode == node) return;
939 if (node == fStartContainer
945 if (node == fEndContainer
958 void receiveReplacedText(Node node) {
959 if (node == null) return;
960 if (node == fStartContainer
964 if (node == fEndContainer
972 * This node has already been inserted into the DOM.
975 public void insertedNodeFromDOM(Node node) {
976 if (node == null) return;
977 if (fInsertNode == node) return;
980 Node parent = node.getParentNode();
983 int index = indexOf(node, fStartContainer);
990 int index = indexOf(node, fEndContainer);
1013 * a node is deleted, because at that time it is
1016 void removeNode(Node node) {
1017 if (node == null) return;
1018 if (fRemoveChild == node) return;
1020 Node parent = node.getParentNode();
1023 int index = indexOf(node, fStartContainer);
1030 int index = indexOf(node, fEndContainer);
1038 if (isAncestorOf(node, fStartContainer)) {
1040 fStartOffset = indexOf( node, parent);
1042 if (isAncestorOf(node, fEndContainer)) {
1044 fEndOffset = indexOf( node, parent);
1062 * selected by this range. For each such node, different
1209 // Text node needs special case handling
1216 // set the original text node to its new value
1481 * operates on each "boundary node" according to the
1505 * The "right boundary" is the highest subtree node
1512 * @param root The node that is the root of the "right boundary" subtree.
1520 * a node containing the boundaries content.
1533 * @return Returns a node that is the result of visiting nodes.
1583 * operates on each "boundary node" according to the
1608 * The "left boundary" is the highest subtree node
1615 * @param root The node that is the root of the "left boundary" subtree.
1623 * a node containing the boundaries content.
1636 * @return Returns a node that is the result of visiting nodes.
1681 * Utility method for traversing a single node.
1682 * Does not properly handle a text node containing both the
1686 * @param n The node to be traversed.
1689 * Set to true if the node is fully selected. Should be
1692 * text node that is boththe start and end container is not
1696 * @param isLeft Is true if we are traversing the node as part of navigating
1707 * return the original node.
1711 * return a cloned node.
1714 * node from it's parent, but will return null.
1717 * @return Returns a node that is the result of visiting the node.
1731 * Utility method for traversing a single node when
1732 * we know a-priori that the node if fully
1735 * @param n The node to be traversed.
1743 * return the original node.
1747 * return a cloned node.
1750 * node from it's parent, but will return null.
1753 * @return Returns a node that is the result of visiting the node.
1780 * Utility method for traversing a single node when
1781 * we know a-priori that the node if partially
1782 * selected and is not a text node.
1784 * @param n The node to be traversed.
1792 * return the original node.
1796 * return a cloned node.
1799 * node from it's parent, but will return null.
1802 * @return Returns a node that is the result of visiting the node.
1820 * Utility method for traversing a text node that we know
1825 * @param n The node to be traversed.
1827 * @param isLeft Is true if we are traversing the node as part of navigating
1838 * return the original node.
1842 * return a cloned node.
1845 * node from it's parent, but will return null.
1848 * @return Returns a node that is the result of visiting the node.
1890 // If the node contains text, ensure that the
1902 // Since the node is not text, ensure that the offset
1912 * Given a node, calculate what the Range's root container
1913 * for that node would be.
1915 private Node getRootContainer( Node node )
1917 if ( node==null )
1920 while( node.getParentNode()!=null )
1921 node = node.getParentNode();
1922 return node;
1926 * Returns true IFF the given node can serve as a container
1929 private boolean isLegalContainer( Node node )
1931 if ( node==null )
1934 while( node!=null )
1936 switch( node.getNodeType() )
1943 node = node.getParentNode();
1951 * Finds the root container for the given node and determines
1957 private boolean hasLegalRootContainer( Node node )
1959 if ( node==null )
1962 Node rootContainer = getRootContainer( node );
1974 * Returns true IFF the given node can be contained by
1977 private boolean isLegalContainedNode( Node node )
1979 if ( node==null )
1981 switch( node.getNodeType() )
1993 Node nextNode(Node node, boolean visitChildren) {
1995 if (node == null) return null;
1999 result = node.getFirstChild();
2006 result = node.getNextSibling();
2013 Node parent = node.getParentNode();
2032 for (Node node=b; node != null; node=node.getParentNode()) {
2033 if (node == a) return true;
2042 for(Node node = parent.getFirstChild(); node!= child; node=node.getNextSibling()) {
2049 * Utility method to retrieve a child node by index. This method
2050 * assumes the caller is trying to find out which node is
2053 * first node selected is the parent node itself.
2055 * @param container A container node
2057 * @param offset An offset within the container for which a selected node should
2061 * @return Returns either a child node of the container or the