function isInDocument(node) {
	  return containsNode(document.documentElement, node);
	}
@restoreSelection: If any selection information was potentially lost,
restore it. This is useful when performing operations that could remove dom
nodes and place them back in, resulting in focus being lost.