function findAncestorOffsetKey(node: Node): ?string {
  let searchNode: ?Node = node;
  while (
    searchNode &&
    searchNode !== getCorrectDocumentFromNode(node).documentElement
  ) {
    const key = getSelectionOffsetKeyForNode(searchNode);
    if (key != null) {
      return key;
    }
    searchNode = searchNode.parentNode;
  }
  return null;
}
Get the key from the node's nearest offset-aware ancestor.