See if the element can be found at any of the rect's points

@author   Jelle De Loecker   <jelle@develry.be>
@since    1.2.2
@version  1.2.2

@param    {HTMLElement}   element
@param    {Object}        rect

@return   {Boolean}
766690
function elementAtRectPoints(element, rect) {

	var sample;

	// Get the first sample
	sample = document.elementFromPoint(rect.left, ~~rect.top);

	if (sample == element || isChild(element, sample)) {
		return true;
	}

	// Get the second sample
	sample = document.elementFromPoint(rect.left, ~~rect.bottom);

	if (sample == element || isChild(element, sample)) {
		return true;
	}

	// Get the third sample
	sample = document.elementFromPoint(rect.right, ~~rect.bottom);

	if (sample == element || isChild(element, sample)) {
		return true;
	}

	// Get the fourth sample
	sample = document.elementFromPoint(rect.right, ~~rect.top);

	if (sample == element || isChild(element, sample)) {
		return true;
	}

	return false;
}
480390
function getElementSize(element) {
            if (!element.getBoundingClientRect) {
                return {
                    width: element.offsetWidth,
                    height: element.offsetHeight
                }
            }

            var rect = element.getBoundingClientRect();
            return {
                width: Math.round(rect.width),
                height: Math.round(rect.height)
            }
        }
922817
function( element )
	{
		var childNodes = element.getChildren();

		for ( var i = 0, count = childNodes.count() ; i < count ; i++ )
		{
			var child = childNodes.getItem( i );

			if ( child.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[ child.getName() ] )
				return true;
		}

		return false;
	}
1320836
function (element, overlay) {
            var geometry = aria.utils.Dom.getGeometry(element);
            var viewportSize = aria.utils.Dom.getViewportSize();
            var overlayGeometry = null;

            if (geometry) {
                var width1, width2, height1, height2;

                var overlayGeometryViewportRelative = {
                    x : Math.max(geometry.x, 0),
                    y : Math.max(geometry.y, 0)
                };
                if (overlay.style.position == "absolute") {
                    // geometry is relative to viewport
                    // overlayGeometry will be relative to the page!
                    var documentScroll = aria.utils.Dom._getDocumentScroll();
                    overlayGeometry = {
                        x : Math.max(geometry.x, 0) + documentScroll.scrollLeft,
                        y : Math.max(geometry.y, 0) + documentScroll.scrollTop
                    };
                } else { // fixed
                    // geometry is relative to viewport
                    // overlayGeometry will be relative to the viewport too
                    overlayGeometry = overlayGeometryViewportRelative;
                }

                // "cut-off" the overlay if the element stands out of the viewport to the left / top
                width1 = geometry.width + Math.min(geometry.x, 0);
                height1 = geometry.height + Math.min(geometry.y, 0);

                // "cut-off" the overlay if the element stands out of the viewport to the right / bottom
                width2 = viewportSize.width - overlayGeometryViewportRelative.x;
                height2 = viewportSize.height - overlayGeometryViewportRelative.y;

                overlayGeometry.width = Math.min(width1, width2);
                overlayGeometry.height = Math.min(height1, height2);
            }

            var style = overlay.style;
            // geometry may be null if the element is not currently visible
            if (overlayGeometry && overlayGeometry.height > 0 && overlayGeometry.width > 0) {
                style.top = overlayGeometry.y + "px";
                style.left = overlayGeometry.x + "px";
                style.width = overlayGeometry.width + "px";
                style.height = overlayGeometry.height + "px";
                style.display = "block";
                var browser = ariaCoreBrowser;
                if (browser.isIE && browser.majorVersion < 9 && overlay.firstChild) {
                    overlay.firstChild.style.top = Math.round(overlayGeometry.height / 2) + "px";
                }
            } else {
                style.display = "none";
            }
        }
235942
function(elementA, elementB) {

        var isSuccessor = false;
        this.search(elementA, function(element) {
            if (element === elementB && element !== elementA) {
                isSuccessor = true;
                return false;
            }
        }, { outbound: true });
        return isSuccessor;
    }
683162
public static boolean isMainElement( Element element ){
        switch( element.getType() ) {
            case START:
            case END:
            case VALUE:
            case CALL:
            case CALL_ASYNC:
            case HUMAN_TASK:
            case WAIT_SIGNAL:
            case WAIT_TIMER:
            case WAIT_UNTIL_DATE:
            case CREATE_INSTANCE:
            case WHILE_DO_BEGIN:
            case WHILE_DO_END:
            case DO_WHILE_BEGIN:
            case DO_WHILE_END:
            case IF:
            case ELSE_IF:
            case ELSE:
            case END_IF:
            case SPLIT:
            case BRANCH:
            case JOIN_FIRST:
            case JOIN_ALL:
            case ESCALATE:
            case VALIDATE_INPUT_VARIABLE:
                return true;
            default :
                return false;
        }
    }
1359021
function(element) {
    if('TEXTAREA'===element.nodeName
      ||('INPUT'===element.nodeName&&element.hasAttribute('type')
        &&('text'===element.getAttribute('type')
          ||'number'===element.getAttribute('type'))
      )
    ) {
      return true;
    }
    return false;
  }
606927
function intersectRect(rect, point) {
  var x = rect.x;
  var y = rect.y;

  // Rectangle intersection algorithm from:
  // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes
  var dx = point.x - x;
  var dy = point.y - y;
  var w = rect.width / 2;
  var h = rect.height / 2;

  if (!dx && !dy) {
    throw new Error("Not possible to find intersection inside of the rectangle");
  }

  var sx, sy;
  if (Math.abs(dy) * w > Math.abs(dx) * h) {
    // Intersection is top or bottom of rect.
    if (dy < 0) {
      h = -h;
    }
    sx = h * dx / dy;
    sy = h;
  } else {
    // Intersection is left or right of rect.
    if (dx < 0) {
      w = -w;
    }
    sx = w;
    sy = w * dy / dx;
  }

  return { x: x + sx, y: y + sy };
}
88053
function inViewport(el, options = { tolerance: 0 }) {
    if (!el) {
        throw new Error('You should specify the element you want to test');
    }

    if (typeof el === 'string') {
        el = document.querySelector(el);
    }

    const elRect = el.getBoundingClientRect();

    return (
        // Check bottom boundary
        elRect.bottom - options.tolerance > 0 &&

        // Check right boundary
        elRect.right - options.tolerance > 0 &&

        // Check left boundary
        elRect.left + options.tolerance < (window.innerWidth ||
        document.documentElement.clientWidth) &&

        // Check top boundary
        elRect.top + options.tolerance < (window.innerHeight ||
        document.documentElement.clientHeight)
    );
}
1235927
function(element) {

        return !this._out[element.id] || joint.util.isEmpty(this._out[element.id]);
    }
181035
public static boolean contains(Iterator<?> iterator, Object element) {
        if (iterator != null) {
            while (iterator.hasNext()) {
                Object candidate = iterator.next();
                if (ObjectUtils.nullSafeEquals(candidate, element)) {
                    return true;
                }
            }
        }
        return false;
    }
233626
function contains( element ) {
    for( var i = 0, len = lists.length; i < len; i++ ) {
      if( lists[i].element == element ) {
        return true;
      }
    }
    return false;
  }
1169074
function checkElement(node, attr, includeScope) {
  var elements = getElements(node, attr);

  if (includeScope && node.hasAttribute(attr)) {
    elements.push(node);
  }

  return elements;
}
776714
function( event, point, element ) {
			var el = elementFromPoint(point, element)
			Syn.trigger(event, point, el || element)
			return el;
		}
362881
function(rect) {
        var minX = rect.origin.x,
            maxX = minX + rect.extent.x;
        var minY = rect.origin.y,
            maxY = minY + rect.extent.y;

        if (rect.extent.x < 0) {
            minX = maxX;
            maxX = rect.origin.x;
        }

        if (rect.extent.y < 0) {
            minY = maxY;
            maxY = rect.origin.y;
        }

        return (
            minX <= this.x && this.x < maxX &&
            minY <= this.y && this.y < maxY
        );
    }
429114
function viewable(el, bounds){
    var rect = el.getBoundingClientRect();
    return (
      (rect.top + rect.height) >= 0 &&
      (rect.left + rect.width) >= 0 &&
      (rect.bottom - rect.height) <= ( (window.innerHeight || document.documentElement.clientHeight) + bounds) &&
      (rect.right - rect.width) <= ( (window.innerWidth || document.documentElement.clientWidth) + bounds)
    );
  }
1127048
function position(element) {
	let elemOffset = offset(element);
	let offsetParentBCR = {top: 0, left: 0};
	let offsetParentEl = parentOffsetEl(element);
	if (offsetParentEl !== document) {
		offsetParentBCR = offset(offsetParentEl);
		offsetParentBCR.top += offsetParentEl.clientTop - offsetParentEl.scrollTop;
		offsetParentBCR.left += offsetParentEl.clientLeft - offsetParentEl.scrollLeft;
	}

	return {
		width: Math.round(isNumber(elemOffset.width) ? elemOffset.width : element.offsetWidth),
		height: Math.round(isNumber(elemOffset.height) ? elemOffset.height : element.offsetHeight),
		top: Math.round(elemOffset.top - offsetParentBCR.top),
		left: Math.round(elemOffset.left - offsetParentBCR.left)
	};
}