function isContained(node, range) {
        var pos1 = dom.comparePoints(node, 0, range.startContainer, range.startOffset);
        var pos2 = dom.comparePoints(node, dom.getNodeLength(node), range.endContainer, range.endOffset);

        return getRootContainer(node) == getRootContainer(range.startContainer)
            && pos1 == 1
            && pos2 == -1;
    }
"contained" as defined by DOM Range: "A Node node is contained in a range
range if node's furthest ancestor is the same as range's root, and (node, 0)
is after range's start, and (node, length of node) is before range's end."