code: function removeWhile(node, pred) {
    while (node) {
      if (isEditable(node) || !pred(node)) {
        break;
      }
  
      const parent = node.parentNode;
      remove(node);
      node = parent;
    }
  }
docs: @method removeWhile
  
  @param {Node} node
  @param {Function} pred