public/ckeditor/_source/core/dom/node.js
function( reference, includeSelf )
		{
			var $ = this.$,
				name;

			if ( !includeSelf )
				$ = $.parentNode;

			while ( $ )
			{
				if ( $.nodeName && ( name = $.nodeName.toLowerCase(), ( typeof reference == 'string' ? name == reference : name in reference ) ) )
					return new CKEDITOR.dom.node( $ );

				$ = $.parentNode;
			}
			return null;
		}
function( reference, includeSelf )
		{
			var $ = this.$,
				name;

			if ( !includeSelf )
				$ = $.parentNode;

			while ( $ )
			{
				if ( $.nodeName && ( name = $.nodeName.toLowerCase(), ( typeof reference == 'string' ? name == reference : name in reference ) ) )
					return new CKEDITOR.dom.node( $ );

				$ = $.parentNode;
			}
			return null;
		}
function ( reference , includeSelf ) { var $ = this . $ , name ; if ( ! includeSelf ) $ = $ . parentNode ; while ( $ ) { if ( $ . nodeName && ( name = $ . nodeName . toLowerCase ( ) , ( typeof reference == 'string' ? name == reference : name in reference ) ) ) return new CKEDITOR . dom . node ( $ ) ; $ = $ . parentNode ; } return null ; }
Gets the closest ancestor node of this node, specified by its name.
@param {String} reference The name of the ancestor node to search or
an object with the node names to search for.
@param {Boolean} [includeSelf] Whether to include the current
node in the search.
@returns {CKEDITOR.dom.node} The located ancestor node or null if not found.
@since 3.6.1
@example
// Suppose we have the following HTML structure:
// &lt;div id="outer"&gt;&lt;div id="inner"&gt;&lt;p&gt;&lt;b&gt;Some text&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
// If node == &lt;b&gt;
ascendant = node.getAscendant( 'div' );      // ascendant == &lt;div id="inner"&gt
ascendant = node.getAscendant( 'b' );        // ascendant == null
ascendant = node.getAscendant( 'b', true );  // ascendant == &lt;b&gt;
ascendant = node.getAscendant( { div: 1, p: 1} );      // Searches for the first 'div' or 'p': ascendant == &lt;div id="inner"&gt
Gets the closest ancestor node of this node specified by its name .