src/js/libs/spiritual-gui.js
function(element, skip, one) {
		skip = false; // until DOM setters can finally replace Mutation Observers...
		var att = 'gui-spiritualizing';
		if (!element.hasAttribute(att)) {
			var spirit, spirits = []; // classname = gui.CLASS_NOSPIRITS
			element.setAttribute(att, 'true');
			new gui.Crawler(gui.CRAWLER_SPIRITUALIZE).descend(element, {
				handleElement: function(elm) {
					if (elm !== element && elm.hasAttribute(att)) {
						return one ? gui.Crawler.STOP : gui.Crawler.SKIP_CHILDREN;
					} else {
						if (!skip || elm !== element) {
							spirit = elm.spirit;
							if (!spirit) {
								spirit = gui.Guide._evaluate(elm);
							}
							if (spirit) {
								if (!spirit.life.attached) {
									spirits.push(spirit);
								}
							}
						}
						if (one) {
							return gui.Crawler.STOP;
						} else if (!elm.childElementCount) { //  || gui.CSSPlugin.contains(elm, classname)
							return gui.Crawler.SKIP_CHILDREN;
						} else {
							// TODO: interface for this kind of stuff!
							switch (elm.localName) {
								case "pre":
								case "code":
									return gui.Crawler.SKIP_CHILDREN;
							}
						}
					}
					return gui.Crawler.CONTINUE;
				}
			});
			element.removeAttribute(att);
			this._sequence(spirits);
		}
	}
function(element, skip, one) {
		skip = false; // until DOM setters can finally replace Mutation Observers...
		var att = 'gui-spiritualizing';
		if (!element.hasAttribute(att)) {
			var spirit, spirits = []; // classname = gui.CLASS_NOSPIRITS
			element.setAttribute(att, 'true');
			new gui.Crawler(gui.CRAWLER_SPIRITUALIZE).descend(element, {
				handleElement: function(elm) {
					if (elm !== element && elm.hasAttribute(att)) {
						return one ? gui.Crawler.STOP : gui.Crawler.SKIP_CHILDREN;
					} else {
						if (!skip || elm !== element) {
							spirit = elm.spirit;
							if (!spirit) {
								spirit = gui.Guide._evaluate(elm);
							}
							if (spirit) {
								if (!spirit.life.attached) {
									spirits.push(spirit);
								}
							}
						}
						if (one) {
							return gui.Crawler.STOP;
						} else if (!elm.childElementCount) { //  || gui.CSSPlugin.contains(elm, classname)
							return gui.Crawler.SKIP_CHILDREN;
						} else {
							// TODO: interface for this kind of stuff!
							switch (elm.localName) {
								case "pre":
								case "code":
									return gui.Crawler.SKIP_CHILDREN;
							}
						}
					}
					return gui.Crawler.CONTINUE;
				}
			});
			element.removeAttribute(att);
			this._sequence(spirits);
		}
	}
function ( element , skip , one ) { skip = false ; // until DOM setters can finally replace Mutation Observers... var att = 'gui-spiritualizing' ; if ( ! element . hasAttribute ( att ) ) { var spirit , spirits = [ ] ; // classname = gui.CLASS_NOSPIRITS element . setAttribute ( att , 'true' ) ; new gui . Crawler ( gui . CRAWLER_SPIRITUALIZE ) . descend ( element , { handleElement : function ( elm ) { if ( elm !== element && elm . hasAttribute ( att ) ) { return one ? gui . Crawler . STOP : gui . Crawler . SKIP_CHILDREN ; } else { if ( ! skip || elm !== element ) { spirit = elm . spirit ; if ( ! spirit ) { spirit = gui . Guide . _evaluate ( elm ) ; } if ( spirit ) { if ( ! spirit . life . attached ) { spirits . push ( spirit ) ; } } } if ( one ) { return gui . Crawler . STOP ; } else if ( ! elm . childElementCount ) { //  || gui.CSSPlugin.contains(elm, classname) return gui . Crawler . SKIP_CHILDREN ; } else { // TODO: interface for this kind of stuff! switch ( elm . localName ) { case "pre" : case "code" : return gui . Crawler . SKIP_CHILDREN ; } } } return gui . Crawler . CONTINUE ; } } ) ; element . removeAttribute ( att ) ; this . _sequence ( spirits ) ; } }
Evaluate spirits for element and subtree.

- Construct spirits in document order
- Fire life cycle events except `ready` in document order
- Fire `ready` in reverse document order (innermost first)

TODO: Create a dedicated crawler subclass for this purpose.
@param {Element} element
@param {boolean} skip Skip the element?
@param {boolean} one Skip the subtree?
Evaluate spirits for element and subtree .