function findEndPoint(node, root) {
				do {
					if (node.parentNode == root) {
						return node;
					}

					node = node.parentNode;
				} while (node);
			}
Find an end point this is the node just before the common ancestor root.

@private
@param {Node} node Node to start at.
@param {Node} root Root/ancestor element to stop just before.
@return {Node} Node just before the root element.