example-d3/webworker.js
/** Returns an array containing all the ancestors down to a node.
   * The array starts with document.
   */
Returns an array containing all the ancestors down to a node.
The array starts with document.
Returns an array containing all the ancestors down to a node . The array starts with document .
function nodeAndAncestors(node) {
    var ancestors = [node];
    var p = node;
    while (p = p.parentNode || p.ownerElement) {
      ancestors.unshift(p);
    }
    return ancestors;
  }
function nodeAndAncestors ( node ) { var ancestors = [ node ] ; var p = node ; while ( p = p . parentNode || p . ownerElement ) { ancestors . unshift ( p ) ; } return ancestors ; }
Returns an array containing all the ancestors down to a node.
Returns an array containing all the ancestors down to a node .