function(node) {
                assertRangeValid(this);

                var parent = node.parentNode;
                var nodeIndex = getNodeIndex(node);

                if (!parent) {
                    throw new DOMException("NOT_FOUND_ERR");
                }

                var startComparison = this.comparePoint(parent, nodeIndex),
                    endComparison = this.comparePoint(parent, nodeIndex + 1);

                if (startComparison < 0) { // Node starts before
                    return (endComparison > 0) ? n_b_a : n_b;
                } else {
                    return (endComparison > 0) ? n_a : n_i;
                }
            }
function(node) {
                assertRangeValid(this);

                var parent = node.parentNode;
                var nodeIndex = getNodeIndex(node);

                if (!parent) {
                    throw new DOMException("NOT_FOUND_ERR");
                }

                var startComparison = this.comparePoint(parent, nodeIndex),
                    endComparison = this.comparePoint(parent, nodeIndex + 1);

                if (startComparison < 0) { // Node starts before
                    return (endComparison > 0) ? n_b_a : n_b;
                } else {
                    return (endComparison > 0) ? n_a : n_i;
                }
            }
function ( node ) { assertRangeValid ( this ) ; var parent = node . parentNode ; var nodeIndex = getNodeIndex ( node ) ; if ( ! parent ) { throw new DOMException ( "NOT_FOUND_ERR" ) ; } var startComparison = this . comparePoint ( parent , nodeIndex ) , endComparison = this . comparePoint ( parent , nodeIndex + 1 ) ; if ( startComparison < 0 ) { // Node starts before return ( endComparison > 0 ) ? n_b_a : n_b ; } else { return ( endComparison > 0 ) ? n_a : n_i ; } }
The methods below are all non-standard. The following batch were introduced by Mozilla but have since been removed from Mozilla.
The methods below are all non - standard . The following batch were introduced by Mozilla but have since been removed from Mozilla .
Returns the index of the node in the tree