function removeNode(node) {
  // important that we want to do this only if the node has a logical parent
  let logicalParent = node.__shady && node.__shady.parentNode;
  let distributed;
  let ownerRoot = ownerShadyRootForNode(node);
  if (logicalParent || ownerRoot) {
    // distribute node's parent iff needed
    distributed = maybeDistributeParent(node);
    if (logicalParent) {
      recordRemoveChild(node, logicalParent);
    }
    // remove node from root and distribute it iff needed
    let removedDistributed = ownerRoot &&
      _removeDistributedChildren(ownerRoot, node);
    let addedInsertionPoint = (logicalParent && ownerRoot &&
      logicalParent.localName === ownerRoot.getInsertionPointTag());
    if (removedDistributed || addedInsertionPoint) {
      ownerRoot._skipUpdateInsertionPoints = false;
      updateRootViaContentChange(ownerRoot);
    }
  }
  _removeOwnerShadyRoot(node);
  return distributed;
}
/**
 * Try to remove node: update logical info and perform distribution iff
 * needed. Return true if the removal has been handled.
 * note that it's possible for both the node's host and its parent
 * to require distribution... both cases are handled here.
 * @param {Node} node
 * @return {boolean}
 */
Try to remove node: update logical info and perform distribution iff
needed. Return true if the removal has been handled.
note that it's possible for both the node's host and its parent
to require distribution... both cases are handled here.
@param {Node} node
@return {boolean}
Try to remove node : update logical info and perform distribution iff needed . Return true if the removal has been handled . note that it ' s possible for both the node ' s host and its parent to require distribution ... both cases are handled here . @param { Node } node @return { boolean }
function removeNode(node) {
  let logicalParent = node.__shady && node.__shady.parentNode;
  let distributed;
  let ownerRoot = ownerShadyRootForNode(node);
  if (logicalParent || ownerRoot) {
    distributed = maybeDistributeParent(node);
    if (logicalParent) {
      recordRemoveChild(node, logicalParent);
    }
    let removedDistributed = ownerRoot &&
      _removeDistributedChildren(ownerRoot, node);
    let addedInsertionPoint = (logicalParent && ownerRoot &&
      logicalParent.localName === ownerRoot.getInsertionPointTag());
    if (removedDistributed || addedInsertionPoint) {
      ownerRoot._skipUpdateInsertionPoints = false;
      updateRootViaContentChange(ownerRoot);
    }
  }
  _removeOwnerShadyRoot(node);
  return distributed;
}
function removeNode ( node ) { let logicalParent = node . __shady && node . __shady . parentNode ; let distributed ; let ownerRoot = ownerShadyRootForNode ( node ) ; if ( logicalParent || ownerRoot ) { distributed = maybeDistributeParent ( node ) ; if ( logicalParent ) { recordRemoveChild ( node , logicalParent ) ; } let removedDistributed = ownerRoot && _removeDistributedChildren ( ownerRoot , node ) ; let addedInsertionPoint = ( logicalParent && ownerRoot && logicalParent . localName === ownerRoot . getInsertionPointTag ( ) ) ; if ( removedDistributed || addedInsertionPoint ) { ownerRoot . _skipUpdateInsertionPoints = false ; updateRootViaContentChange ( ownerRoot ) ; } } _removeOwnerShadyRoot ( node ) ; return distributed ; }
Try to remove node: update logical info and perform distribution iff
 needed.
Try to remove node : update logical info and perform distribution iff needed .
// important that we want to do this only if the node has a logical parent // distribute node's parent iff needed // remove node from root and distribute it iff needed