function getNodeLength(node) {
	  return node.nodeValue === null ? node.childNodes.length : node.nodeValue.length;
	}
In modern non-IE browsers, we can support both forward and backward
selections.

Note: IE10+ supports the Selection object, but it does not support
the `extend` method, which means that even in modern IE, it's not possible
to programatically create a backward selection. Thus, for all IE
versions, we use the old IE API to create our selections.