Get object describing the nodes which contain characters at offset.

@param {DOMElement|DOMTextNode} root
@param {number} offset
@return {?object}
502791
function getNodeForCharacterOffset(root, offset) {
  var node = getLeafNode(root);
  var nodeStart = 0;
  var nodeEnd = 0;

  while (node) {
    if (node.nodeType === TEXT_NODE$3) {
      nodeEnd = nodeStart + node.textContent.length;

      if (nodeStart <= offset && nodeEnd >= offset) {
        return {
          node: node,
          offset: offset - nodeStart
        };
      }

      nodeStart = nodeEnd;
    }

    node = getLeafNode(getSiblingNode(node));
  }
}
280525
def get_at(self, root_node, key):
        
        return self._get(root_node, bin_to_nibbles(to_string(key)))
1168226
function findLeaf(node, offset) {
          if (offset === undef) {
            offset = node.nodeType === 3 ? node.length : node.childNodes.length;
          }

          while (node && node.hasChildNodes()) {
            node = node.childNodes[offset];
            if (node) {
              offset = node.nodeType === 3 ? node.length : node.childNodes.length;
            }
          }
          return { node: node, offset: offset };
        }
948525
function (node) {
		var r = this.getBoundingRect(node);

		var pageYOffset = (window.pageYOffset === undefined) ? document.documentElement.scrollTop : window.pageYOffset;
		var pageXOffset = (window.pageXOffset === undefined) ? document.documentElement.scrollLeft : window.pageXOffset;
		var rHeight = (r.height === undefined) ? (r.bottom - r.top) : r.height;
		var rWidth = (r.width === undefined) ? (r.right - r.left) : r.width;

		return {top: r.top + pageYOffset, left: r.left + pageXOffset, height: rHeight, width: rWidth};
	}
854165
function getOffset() {
      var indentation = []
      var pos = line + 1

      // Done.  Called when the last character is eaten to retrieve the range’s
      // offsets.
      return function() {
        var last = line + 1

        while (pos < last) {
          indentation.push((offset[pos] || 0) + 1)

          pos++
        }

        return indentation
      }
    }
291507
function (element) {
      var docDomEl = $document[0];
      var offsetParent = element.offsetParent || docDomEl;
      while (offsetParent && offsetParent !== docDomEl && isStaticPositioned(offsetParent) ) {
        offsetParent = offsetParent.offsetParent;
      }
      return offsetParent || docDomEl;
    }
549997
function(ns, root){
    if (!ns) {
      return null;
    }
    var nsParts = ns.split(".");
    root = root || this;
    for (var i = 0, len = nsParts.length; i < len; i++) {
      if (typeof root[nsParts[i]] === "undefined") {
        root[nsParts[i]] = {};
      }
      root = root[nsParts[i]];
    }
    return root;
  }
1162634
function (point) {
            var textRangeInfo = function (container, offset) {
                var node, isCollapseToStart;

                if (dom.isText(container)) {
                    var prevTextNodes = dom.listPrev(container, func.not(dom.isText));
                    var prevContainer = list.last(prevTextNodes).previousSibling;
                    node =  prevContainer || container.parentNode;
                    offset += list.sum(list.tail(prevTextNodes), dom.nodeLength);
                    isCollapseToStart = !prevContainer;
                } else {
                    node = container.childNodes[offset] || container;
                    if (dom.isText(node)) {
                        return textRangeInfo(node, 0);
                    }

                    offset = 0;
                    isCollapseToStart = false;
                }

                return {
                    node: node,
                    collapseToStart: isCollapseToStart,
                    offset: offset
                };
            };

            var textRange = document.body.createTextRange();
            var info = textRangeInfo(point.node, point.offset);

            textRange.moveToElementText(info.node);
            textRange.collapse(info.collapseToStart);
            textRange.moveStart('character', info.offset);
            return textRange;
        }
1128632
function (el) {
		var offsets = el.getPosition(); // #1496
		return {
			left: offsets.x,
			top: offsets.y
		};
	}
654518
function _offsetPos(pos, offset) {
        return {line: pos.line, ch: pos.ch + offset};
    }
1200717
public static String getText(final Node root) {
        if (root == null) {
            return "";
        } else {
            final StringBuilder result = new StringBuilder(1024);
            if (root.hasChildNodes()) {
                final NodeList list = root.getChildNodes();
                for (int i = 0; i < list.getLength(); i++) {
                    final Node childNode = list.item(i);
                    if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                        final Element e = (Element) childNode;
                        final String value = e.getAttribute(ATTRIBUTE_NAME_CLASS);
                        if (!excludeList.contains(value)) {
                            final String s = getText(e);
                            result.append(s);
                        }
                    } else if (childNode.getNodeType() == Node.TEXT_NODE) {
                        result.append(childNode.getNodeValue());
                    }
                }
            } else if (root.getNodeType() == Node.TEXT_NODE) {
                result.append(root.getNodeValue());
            }
            return result.toString();
        }
    }
238071
function() {
			return {
				textNode: this.textNode,
				offset: this.offset,
				character: this.textNode ? this.textNode.getText().charAt( this.offset ) : null,
				hitMatchBoundary: this._.matchBoundary
			};
		}
1341699
function (elem, offsetParent) {
  var offset, parentOffset

  if (window.jQuery) {
    if (!offsetParent) {
      return window.jQuery(elem).position()
    }

    offset = window.jQuery(elem).offset()
    parentOffset = window.jQuery(offsetParent).offset()

    // Get element offset relative to offsetParent
    return {
      top: offset.top - parentOffset.top,
      left: offset.left - parentOffset.left
    }
  }

  parentOffset = { top: 0, left: 0 }

  // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
  if (window.getComputedStyle(elem).position === 'fixed' ) {
    // We assume that getBoundingClientRect is available when computed position is fixed
    offset = elem.getBoundingClientRect()
  }
  else {
    if (!offsetParent) {
      // Get *real* offsetParent
      offsetParent = position.offsetParent(elem)
    }

    // Get correct offsets
    offset = offsetFunc(elem)
    if (offsetParent.nodeName !== 'HTML') {
      parentOffset = offsetFunc(offsetParent)
    }

    // Add offsetParent borders
    parentOffset.top += parseInt(window.getComputedStyle(offsetParent).borderTopWidth, 10)
    parentOffset.left += parseInt(window.getComputedStyle(offsetParent).borderLeftWidth, 10)
  }

  // Subtract parent offsets and element margins
  return {
    top: offset.top - parentOffset.top - parseInt(window.getComputedStyle(elem).marginTop, 10),
    left: offset.left - parentOffset.left - parseInt(window.getComputedStyle(elem).marginLeft, 10)
  }
}
262772
function(ast, offset) {
			var found = null;
			var dom = ast;
			var missingTagClose = false;
			if (!Array.isArray(ast) && ast.children){
				dom = ast.children;
			}
			 Visitor.visit(dom, {
	            visitNode: function(node) {
					if(node.range[0] <= offset) {
						found = node;
					} else {
					    return Visitor.BREAK;
					}      
	            },
	            endVisitNode: function(node) {
	            	if(found && !missingTagClose && offset >= found.range[1] && offset > node.range[0]) {
	            		found = node;
	            		// If at the boundary of a tag range and there is a missing end tag, return the innermost tag  <a><b></a>
	            		if (offset === found.range[1] && found.endrange && found.openrange && found.endrange[1] === found.openrange[1]){
	            			missingTagClose = true;
	            		}
	            	}
	            }
	        });
	        return found;
		}
1205940
function coerceRoot(root) {
  var coerced = root.substring().trim();
  var len = coerced.length;
  if (len > 0 && coerced[len - 1] !== '/') {
    coerced = coerced + '/';
  }
  return coerced;
}
497378
function (start) {
        var container, parent, sibling, siblingName, root;

        container = parent = start ? startContainer : endContainer;
        siblingName = start ? 'previousSibling' : 'nextSibling';
        root = dom.getRoot();

        // If it's a text node and the offset is inside the text
        if (container.nodeType === 3 && !isWhiteSpaceNode(container)) {
          if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
            return container;
          }
        }

        /*eslint no-constant-condition:0 */
        while (true) {
          // Stop expanding on block elements
          if (!format[0].block_expand && dom.isBlock(parent)) {
            return parent;
          }

          // Walk left/right
          for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
            if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) {
              return parent;
            }
          }

          // Check if we can move up are we at root level or body level
          if (parent === root || parent.parentNode === root) {
            container = parent;
            break;
          }

          parent = parent.parentNode;
        }

        return container;
      }
73835
function(offset){
            if(arguments.length > 0){
                this.each(function(inx,ele){
                    var node = vQ(ele);
                    var coords = node.offset(),
                        parentOffset = ele.offsetParent.offset(),
                        props = {
                            top: coords.top - parentOffset.top,
                            left: coords.left - parentOffset.left
                        };
                    if (node.css('position') == 'static'){
                        props['position'] = 'relative';
                    }
                    node.css(props);
                });
            }
            if (!this.length) return null;
            if (!vQ.contains(document.documentElement, this[0]))
                return {top: 0, left: 0};
            var obj = this[0].getBoundingClientRect();
            return {
                left: obj.left + window.pageXOffset,
                top: obj.top + window.pageYOffset,
                width: Math.round(obj.width),
                height: Math.round(obj.height)
            };
        }