code: function findTextNodeRelative(left, startNode) {
              var walker, lastInlineElement, parentBlockContainer;
  
              startNode = startNode || container;
              parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
  
              // Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680
              // This: <p><br>|</p> becomes <p>|<br></p>
              if (left && startNode.nodeName == 'BR' && isAfterNode && dom.isEmpty(parentBlockContainer)) {
                container = startNode.parentNode;
                offset = dom.nodeIndex(startNode);
                normalized = true;
                return;
              }
  
              // Walk left until we hit a text node we can move to or a block/br/img
              walker = new TreeWalker(startNode, parentBlockContainer);
              while ((node = walker[left ? 'prev' : 'next']())) {
                // Break if we hit a non content editable node
                if (dom.getContentEditableParent(node) === "false" || isCeFalseCaretContainer(node, dom.getRoot())) {
                  return;
                }
  
                // Found text node that has a length
                if (node.nodeType === 3 && node.nodeValue.length > 0) {
                  if (hasParentWithName(node, body, 'A') === false) {
                    container = node;
                    offset = left ? node.nodeValue.length : 0;
                    normalized = true;
                  }
  
                  return;
                }
  
                // Break if we find a block or a BR/IMG/INPUT etc
                if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
                  return;
                }
  
                lastInlineElement = node;
              }
  
              // Only fetch the last inline element when in caret mode for now
              if (collapsed && lastInlineElement) {
                container = lastInlineElement;
                normalized = true;
                offset = 0;
              }
            }
docs: Walks the dom left/right to find a suitable text node to move the endpoint into It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG