code: function isEffectivelyContained(node, range) {
          if (range.collapsed) {
              return false;
          }
  
          // "node is contained in range."
          if (isContained(node, range)) {
              return true;
          }
  
          var sc = range.startContainer, so = range.startOffset;
          var ec = range.endContainer, eo = range.endOffset;
  
          // "node is range's start node, it is a Text node, its length is different
          // from range's start offset."
          var isCharData = dom.isCharacterDataNode(node);
          if (node == sc && isCharData && dom.getNodeLength(node) != so) {
              return true;
          }
  
          // "node is range's end node, it is a Text node, range's end offset is not
          // 0."
          if (node == ec && isCharData && eo != 0) {
              return true;
          }
  
          // "node has at least one child; and all its children are effectively
          // contained in range; and either range's start node is not a descendant of
          // node or is not a Text node or range's start offset is zero or range is
          // collapsed; and either range's end node is not a descendant of node or is
          // not a Text node or range's end offset is its end node's length."
          var children = node.childNodes, childCount = children.length;
          if (childCount != 0) {
              for (var i = 0; i < childCount; ++i) {
                  if (!isEffectivelyContained(children[i], range)) {
                      return false;
                  }
              }
              if ((!dom.isAncestorOf(node, sc) || sc.nodeType != 3 || so == 0)
                      && (!dom.isAncestorOf(node, ec) || ec.nodeType != 3 || eo == dom.getNodeLength(ec))) {
                  return true;
              }
          }
          return false;
      }
docs: "A node node is effectively contained in a range range if at least one of the following holds:"