Finds the position of the opening JSX tag in the source code.
761234
function getViewRoot(source) {
	const tokens = parse(source);

	let position = tokens.length;
	let tagDepth = 0;
	let tagName;
	let token;

	/**
	 * Loop backwards through the view's source and find the last closing tag
	 * and its matching opening tag to determine the view's root node position.
	 */
	while (token = tokens[--position]) {
		if (token.type !== TokenTypes.TagStart) {
			continue;
		}

		let tag = parseTag(position, tokens);

		// the last node in the source is a self-closing tag; use that
		if (!tagName && tag.self) {
			break;
		}

		// this is the last tag in the source; save the name and find its pair
		if (!tagName) {
			tagName = tag.name;
			tagDepth++;
			continue;
		}

		// ignore any tags with a different name
		if (tag.name !== tagName) {
			continue;
		}

		// increase tags' depth in the tree for closing tags
		if (!tag.open) {
			tagDepth++;
		}

		// decrease tags' depth in the tree for opening (not self-closing) tags
		if (tag.open && !tag.self) {
			tagDepth--;
		}

		// if the tag's depth reached 0, it means this is the opening tag
		if (tagDepth === 0) {
			break;
		}
	}

	token = tokens[position];

	return token ? token.start : 0;
}
33902
function positionFromTop(container, el){
    
    var containerTop = container.position().top
      , windowTop = $window.scrollTop()
    if(containerTop > windowTop) return el.css('top', 0)
      
    var pos = windowTop - containerTop
    
    return el.css('top', pos)
    
    
  }
1029129
function findEscapeEnd(source, offset) {
    for (var i = 0; i < 7 && offset + i < source.length; i++) {
        var code = source.charCodeAt(offset + i);

        if (i !== 6 && isHex(code)) {
            continue;
        }

        if (i > 0) {
            offset += i - 1 + getNewlineLength(source, offset + i, code);
            if (code === SPACE || code === TAB) {
                offset++;
            }
        }

        break;
    }

    return offset;
}
1046296
function (e) {
    var posX = 0, posY = 0;
    e = e || window.event;
    if (typeof e.pageX !== "undefined") {
      posX = e.pageX;
      posY = e.pageY;
    } else if (typeof e.clientX !== "undefined") { // MSIE
      posX = e.clientX + scroll.x;
      posY = e.clientY + scroll.y;
    }
    return {
      left: posX,
      top: posY
    };
  }
131601
function getPosition(el) {
      var xPos = 0;
      var yPos = 0;

      while (el) {
        xPos += el.offsetLeft + el.clientLeft;
        yPos += el.offsetTop + el.clientTop;

        el = el.offsetParent;
      }
      return {
        x: xPos,
        y: yPos
      };
    }
1226189
function(node, offset, source) {
			if (node){
				if (node.type === 'tag'){
					var name = node.name ? node.name.toLowerCase() : '';
					if (name === 'script' || name === 'style') {
						if (node.openrange && node.endrange){
							// If we are in the tag itself we are not actually in the script block
							if (offset < node.openrange[1] || offset > node.endrange[0]){
								return false;
							}
						}
						return true;
					}
				}
			}
			return false;
		}
806683
function postToSource()
			{
				// clear unnecessary tags when editor view empty
				var sourceStrings = editor.text()=="" && editor.html().length<12 ? "" : editor.html();
				
				thisElement.val(extractToText(sourceStrings));
			}
294476
function findPrevHTMLItem(editor) {
		return findItem(editor, true, getOpeningTagFromPosition, function (tag, offset, selRange) {
			return getRangeForHTMLItem(tag, offset, selRange, true);
		});
	}
1128632
function (el) {
		var offsets = el.getPosition(); // #1496
		return {
			left: offsets.x,
			top: offsets.y
		};
	}
914390
function fixElement(i, _pos, flag) {
        var pos = _pos
        var ori = flag == 1 ? 'pos' : 'oppos'

        if (viewPortSize < (params.minView || 0)) { // No headers fixing when no enought space for viewport
            pos = undefined
        }

        // Removing all fixing stuff - we can do this because fixElement triggers only when fixState really changed
        css(elements[i], this.origin.pos, '')
        css(elements[i], this.origin.oppos, '')
        rm(elements[i], params.outside)

        // Fixing if needed
        if (pos !== undefined) {
            pos += 'px'
            css(elements[i], this.origin[ori], pos)
            add(elements[i], params.outside)
        }
    }
901482
private String getSourceCodePath(StackTraceElement stackTraceElement) {
        Objects.requireNonNull(stackTraceElement, Required.STACK_TRACE_ELEMENT.toString());

        String packageName = stackTraceElement.getClassName();
        int position = packageName.lastIndexOf('.');
        if (position > 0) {
            packageName = packageName.substring(0, position);
            return StringUtils.replace(packageName, ".", File.separator) + File.separator + stackTraceElement.getFileName();
        }

        return stackTraceElement.getFileName();
    }
586153
function(inlines) {
  var startpos = this.pos;
  var ticks = this.match(/^`+/);
  if (!ticks) {
    return 0;
  }
  var afterOpenTicks = this.pos;
  var foundCode = false;
  var match;
  while (!foundCode && (match = this.match(/`+/m))) {
    if (match == ticks) {
      inlines.push({ t: 'Code', c: this.subject.slice(afterOpenTicks,
                                   this.pos - ticks.length)
             .replace(/[ \n]+/g,' ')
             .trim() });
      return (this.pos - startpos);
    }
  }
  // If we got here, we didn't match a closing backtick sequence.
  inlines.push({ t: 'Str', c: ticks });
  this.pos = afterOpenTicks;
  return (this.pos - startpos);
}
1321923
function positionElement(element, target, alignment) {
    var elementPoint = elementPositioningPoint(element, alignment.overlay);
    var targetPoint = elementPositioningPoint(target, alignment.target);
    var offset = {
        left: targetPoint.left - elementPoint.left,
        top: targetPoint.top - elementPoint.top
    };
    return {
        left: element.left + offset.left,
        top: element.top + offset.top,
        width: element.width,
        height: element.height
    };
}
1274322
def closest(self, tag):
        """"""

        return CSSMatch(self.selectors, tag, self.namespaces, self.flags).closest()
659691
function getHeadingTopPos (obj) {
    var position = 0
    if (obj != document.querySelector(options.contentSelector && obj != null)) {
      position = obj.offsetTop
      if (options.hasInnerContainers)
        position += getHeadingTopPos(obj.offsetParent)
    }
    return position
  }
193345
function parseEndTag(tag, tagName) {

      // If no tag name is provided, clean shop
      if (!tagName)
        var pos = 0;

      // Find the closest opened tag of the same type
      else {
        tagName = tagName.toLowerCase();
        for (var pos = stack.length - 1; pos >= 0; pos--)
          if (stack[pos] == tagName)
            break;
      }

      if (pos >= 0) {
        // Close all the open elements, up the stack
        for (var i = stack.length - 1; i >= pos; i--)
          results += "</" + stack[i] + ">";

        // Remove the open elements from the stack
        stack.length = pos;
      }

    }
161918
function getChildJSXElements(node, parent) {
  if (node.children.length === 0) return [];
  const childJsxComponentsArr = node
    .children
    .filter(jsx => jsx.type === 'JSXElement'
      && htmlElements.indexOf(jsx.openingElement.name.name) < 0);
  return childJsxComponentsArr
    .map(child => {
      return {
        name: child.openingElement.name.name,
        children: getChildJSXElements(child, parent),
        props: getReactProps(child, parent),
        state: {},
        methods: [],
      };
    });
}