src/js/libs/spiritual-gui.js
function(start, handler) {
		this.direction = gui.Crawler.ASCENDING;
		var supports = gui.hasModule('gui-spirits@wunderbyte.com');
		var isspirit = supports && start instanceof gui.Spirit;
		var win, elm = isspirit ? start.element : start;
		do {
			if (elm.nodeType === Node.DOCUMENT_NODE) {
				if (this.global) {
					win = elm.defaultView;
					if (win.gui.hosted) { // win.parent !== win
						/*
						 * @TODO: iframed document might have navigated elsewhere, stamp this in localstorage
						 * @TODO: sit down and wonder if localstorage is even available in sandboxed iframes...
						 */
						if (win.gui.xhost) {
							elm = null;
							if (gui.Type.isFunction(handler.transcend)) {
								handler.transcend(win.parent, win.gui.xhost, win.gui.$contextid);
							}
						} else {
							elm = win.frameElement;
						}
					} else {
						elm = null;
					}
				} else {
					elm = null;
				}
			}
			if (elm) {
				var directive = this._handleElement(elm, handler);
				switch (directive) {
					case gui.Crawler.STOP:
						elm = null;
						break;
					default:
						elm = elm.parentNode;
						break;
				}
			}
		} while (elm);
	}
function(start, handler) {
		this.direction = gui.Crawler.ASCENDING;
		var supports = gui.hasModule('gui-spirits@wunderbyte.com');
		var isspirit = supports && start instanceof gui.Spirit;
		var win, elm = isspirit ? start.element : start;
		do {
			if (elm.nodeType === Node.DOCUMENT_NODE) {
				if (this.global) {
					win = elm.defaultView;
					if (win.gui.hosted) { // win.parent !== win
						/*
						 * @TODO: iframed document might have navigated elsewhere, stamp this in localstorage
						 * @TODO: sit down and wonder if localstorage is even available in sandboxed iframes...
						 */
						if (win.gui.xhost) {
							elm = null;
							if (gui.Type.isFunction(handler.transcend)) {
								handler.transcend(win.parent, win.gui.xhost, win.gui.$contextid);
							}
						} else {
							elm = win.frameElement;
						}
					} else {
						elm = null;
					}
				} else {
					elm = null;
				}
			}
			if (elm) {
				var directive = this._handleElement(elm, handler);
				switch (directive) {
					case gui.Crawler.STOP:
						elm = null;
						break;
					default:
						elm = elm.parentNode;
						break;
				}
			}
		} while (elm);
	}
function ( start , handler ) { this . direction = gui . Crawler . ASCENDING ; var supports = gui . hasModule ( 'gui-spirits@wunderbyte.com' ) ; var isspirit = supports && start instanceof gui . Spirit ; var win , elm = isspirit ? start . element : start ; do { if ( elm . nodeType === Node . DOCUMENT_NODE ) { if ( this . global ) { win = elm . defaultView ; if ( win . gui . hosted ) { // win.parent !== win /*
						 * @TODO: iframed document might have navigated elsewhere, stamp this in localstorage
						 * @TODO: sit down and wonder if localstorage is even available in sandboxed iframes...
						 */ if ( win . gui . xhost ) { elm = null ; if ( gui . Type . isFunction ( handler . transcend ) ) { handler . transcend ( win . parent , win . gui . xhost , win . gui . $contextid ) ; } } else { elm = win . frameElement ; } } else { elm = null ; } } else { elm = null ; } } if ( elm ) { var directive = this . _handleElement ( elm , handler ) ; switch ( directive ) { case gui . Crawler . STOP : elm = null ; break ; default : elm = elm . parentNode ; break ; } } } while ( elm ) ; }
Crawl DOM ascending.
@param {Element|gui.Spirit} start
@param {object} handler
Crawl DOM ascending .