function containsNextElement(s, node, walkForward) {
   const start = node;
 
   while (node = walkFromNode(node, walkForward)) {
     // eslint-disable-line no-cond-assign
     // walking (left) can contain our own parent, which we don't want
     if (!node.contains(start)) {
       break;
     }
   }
 
   if (!node) {
     return false;
   } // we look for Element as .containsNode says true for _every_ text node, and we only care about
   // elements themselves
 
 
   return node instanceof Element && s.containsNode(node, true);
 }
@param {!Selection} s the window selection to use
@param {!Node} node the node to walk from
@param {boolean} walkForward should this walk in natural direction
@return {boolean} whether the selection contains the following node (even partially)