Posted by flexo on Thu 26th Apr 06:34
download | new post
- walk: while (node != this.t2.parentNode) {
- /* Walk the DOM up ... */
- while(!node.nextSibling) {
- node = node.parentNode;
- var tmp = node.cloneNode(false);
- while(x.length > 0)
- tmp.appendChild(x.shift());
- x = [tmp];
- assert(node);
- }
- /* ... forward (skipping ghost elements) ... */
- do {
- if(!node.nextSibling)
- continue walk;
- node = node.nextSibling;
- assert(node);
- } while(isGhost(node));
- /* ... and down again. */
- while(!isInline(node)) {
- node = node.firstChild;
- assert(node);
- x = [];
- }
- info("pushing %o", node);
- x.push(node);
- }
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.