public/ckeditor/4.4dev/core/dom/node.js
function( normalized ) {
		// Attention: getAddress depends on this.$
		// getIndex is called on a plain object: { $ : node }

		var current = this.$,
			index = -1,
			isNormalizing;

		if ( !this.$.parentNode )
			return index;

		do {
			// Bypass blank node and adjacent text nodes.
			if ( normalized && current != this.$ && current.nodeType == CKEDITOR.NODE_TEXT && ( isNormalizing || !current.nodeValue ) )
				continue;

			index++;
			isNormalizing = current.nodeType == CKEDITOR.NODE_TEXT;
		}
		while ( ( current = current.previousSibling ) );

		return index;
	}
function( normalized ) {
		// Attention: getAddress depends on this.$
		// getIndex is called on a plain object: { $ : node }

		var current = this.$,
			index = -1,
			isNormalizing;

		if ( !this.$.parentNode )
			return index;

		do {
			// Bypass blank node and adjacent text nodes.
			if ( normalized && current != this.$ && current.nodeType == CKEDITOR.NODE_TEXT && ( isNormalizing || !current.nodeValue ) )
				continue;

			index++;
			isNormalizing = current.nodeType == CKEDITOR.NODE_TEXT;
		}
		while ( ( current = current.previousSibling ) );

		return index;
	}
function ( normalized ) { // Attention: getAddress depends on this.$ // getIndex is called on a plain object: { $ : node } var current = this . $ , index = - 1 , isNormalizing ; if ( ! this . $ . parentNode ) return index ; do { // Bypass blank node and adjacent text nodes. if ( normalized && current != this . $ && current . nodeType == CKEDITOR . NODE_TEXT && ( isNormalizing || ! current . nodeValue ) ) continue ; index ++ ; isNormalizing = current . nodeType == CKEDITOR . NODE_TEXT ; } while ( ( current = current . previousSibling ) ) ; return index ; }
Gets the index of a node in an array of its `parent.childNodes`.

Let us assume having the following `childNodes` array:

[ emptyText, element1, text, text, element2 ]
element1.getIndex();		// 1
element1.getIndex( true );	// 0
element2.getIndex();		// 4
element2.getIndex( true );	// 2

@param {Boolean} normalized When `true`, empty text nodes and one followed
by another one text node are not counted in.
@returns {Number} Index of a node.
Gets the index of a node in an array of its parent . childNodes .