Returns true if the element or its parents
has no opacity, visibility or display

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

@param    {HTMLElement}   element

@return   {Boolean}
543431
function isHidden(element) {

	var parent_styles,
	    overflow_x,
	    overflow_y,
	    overflow,
	    parent = element.parentNode,
	    styles;

	if (!parent) {
		return true;
	}

	// Always return false for the document element
	if (isDocumentElement(parent)) {
		return false;
	}

	// Get the computed styles of the element
	styles = getStyle(element);

	// Return true if the element is invisible
	if (   styles.opacity === '0'
		|| styles.display === 'none'
		|| styles.visibility === 'hidden') {
		return true;
	}

	return isHidden(parent);
}
188903
private boolean isVisible() {
		// Root is always visible
		if (getParent() == null) {
			return true;
		}

		TableTreeNode parent = (TableTreeNode) getParent();
		return parent.isVisible() && parent.isExpanded();
	}
1339189
@Override
	public boolean isElementVisible() throws WidgetException {
		try {
			return isVisible() && (getLocationX() > 0) && (getLocationY() > 0);
		} catch (Exception e) {
			throw new WidgetException("Error while determining whether element is visible", locator, e);
		}
	}
521836
function findBackgroundColor(element) {
  if (element == null || typeof element.style === 'undefined') {
    // This element has no background, assume white.
    return 'rgb(255,255,255)';
  }
  const backgroundColor = getComputedStyle(element).backgroundColor;
  if (backgroundColor === 'transparent' || backgroundColor === 'rgba(0, 0, 0, 0)') {
    return findBackgroundColor(element.parentNode);
  } else {
    return backgroundColor;
  }
}
803544
function(node) {
        node = $(node);

        var container = this.container,
            threshold = this.options.threshold,
            conHeight = container.height(),
            conWidth = container.width(),
            scrollTop = container.scrollTop(),
            scrollLeft = container.scrollLeft(),
            nodeOffset = node.offset(),
            left = nodeOffset.left,
            top = nodeOffset.top;

        // Re-adjust the offset to match the parent container
        // is() fails when checking against window
        if (container[0] !== window) {
            var conOffset = container.offset();

            left -= conOffset.left;
            top -= conOffset.top;
        }

        return (
            // Element is not hidden
            node.is(':visible') &&
            // Below the top
            (top >= (scrollTop - threshold)) &&
            // Above the bottom
            (top <= (scrollTop + conHeight + threshold)) &&
            // Right of the left
            (left >= (scrollLeft - threshold)) &&
            // Left of the right
            (left <= (scrollLeft + conWidth + threshold))
        );
    }
904449
function cleanUpElement(element) {
		const childNodes = element.childNodes;

		for (let i = 0; i < childNodes.length; i++) {
			const node = childNodes[i];

			let isVisible = node.nodeType === 1 ? window.getComputedStyle(node).display !== 'none' : true;
			if (isVisible && ['input', 'textarea', 'script', 'noscript', 'style', 'select', 'option', 'button'].indexOf(node.nodeName.toLowerCase()) >= 0) isVisible = false;

			if (!isVisible) {
				element.removeChild(node);
			} else {
				cleanUpElement(node);
			}
		}
	}
575865
function isIndentationElement(node) {
	if (!isHtmlElement(node)) {
		return false;
	}

	if (node.tagName == "BLOCKQUOTE") {
		return true;
	}

	if (node.tagName != "DIV") {
		return false;
	}

	for (var i = 0; i < node.style.length; i++) {
		// Approximate check
		if (/^(-[a-z]+-)?margin/.test(node.style[i])) {
			return true;
		}
	}

	return false;
}
120759
public function isVisible(\Magento\Config\Model\Config\Structure\AbstractElement $element, $scope)
    {
        if (!$element->isAllowed()) {
            return false;
        }

        $isVisible = parent::isVisible($element, $scope);

        if ($isVisible) {
            $isVisible = $element->hasChildren() || $element->getFrontendModel();
        }

        return $isVisible;
    }
1317872
function getHiddenElementHeight (el) {
  var el_style = window.getComputedStyle(el),
    el_display = el_style.display,
    el_position = el_style.position,
    el_visibility = el_style.visibility,
    el_max_height = el_style.maxHeight.replace('px', '').replace('%', ''),

    wanted_height = 0;

  // if its not hidden we just return normal height
  if (el_display !== 'none' && el_max_height !== '0') {
    return el.offsetHeight;
  }

  // the element is hidden so:
  // making the el block so we can meassure its height but still be hidden
  el.style.position = 'absolute';
  el.style.visibility = 'hidden';
  el.style.display = 'block';

  wanted_height = el.offsetHeight;

  // reverting to the original values
  el.style.display = el_display;
  el.style.position = el_position;
  el.style.visibility = el_visibility;

  return wanted_height;
}
1015953
function isElementInViewport(el) {
    var eap;
    var rect = el.getBoundingClientRect();
    var docEl = document.documentElement;
    var vWidth = window.innerWidth || docEl.clientWidth;
    var vHeight = window.innerHeight || docEl.clientHeight;
    var efp = function (x, y) { return document.elementFromPoint(x, y); };
    var contains = el.contains ? (function (node) { return el.contains(node); }) : (function (node) { return el.compareDocumentPosition(node) == 0x10; });
    // Return false if it's not in the viewport
    if (rect.right < 0 || rect.bottom < 0
        || rect.left > vWidth || rect.top > vHeight)
        return false;
    // Return true if any of its four corners are visible
    return ((eap = efp(rect.left, rect.top)) == el || contains(eap)
        || (eap = efp(rect.right, rect.top)) == el || contains(eap)
        || (eap = efp(rect.right, rect.bottom)) == el || contains(eap)
        || (eap = efp(rect.left, rect.bottom)) == el || contains(eap));
}
212880
def assert_element_visible(self, selector, by=By.CSS_SELECTOR,
                               timeout=settings.SMALL_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        self.assert_element(selector, by=by, timeout=timeout)
        return True
1065123
function (element) {
      var parent = element.parent();

      // jqLite might return a non-null, but still empty, parent; so check for parent and length
      while (hasComputedStyle(parent, 'pointer-events', 'none')) {
        parent = parent.parent();
      }

      return parent;
    }
1150723
function(element) {
	    var left = 0, top = 0, el = element;
	    
	    if (el.parentNode) {
			do {
				left += el.offsetLeft;
				top += el.offsetTop;
			} while ((el = el.offsetParent) && el.nodeType < 9);
			
			el = element;
			
			do {
				left -= el.scrollLeft;
				top -= el.scrollTop;
			} while ((el = el.parentNode) && !/body/i.test(el.nodeName));
		}
	
	    return {
			top: top,
	    	right: innerWidth - left - element.offsetWidth,
	    	bottom: innerHeight - top - element.offsetHeight,
	    	left: left,
	    };
	}
619778
public void isElementVisible(By locator, boolean visible) {
		waitForLoaders();
		if (visible) {
			try {
				WebElement found = new WebDriverWait(getWebDriver(), getSeleniumManager().getTimeout())
						.until(ExpectedConditions.visibilityOfElementLocated(locator));
			} catch (WebDriverException e) {
				fail("The element " + locator.toString()
						+ " is not found or invisible where it is expected as present and visible");
			}
		} else {
			try {
				boolean invisible = new WebDriverWait(getWebDriver(), getSeleniumManager().getTimeout())
						.until(ExpectedConditions.invisibilityOfElementLocated(locator));
			} catch (WebDriverException e) {
				fail("The element " + locator.toString() + " is visible where it is expected as invisible");
			}
		}
	}
655782
public static boolean isAtLeastOneChildComponentVisible(Container component) {
        for (Component comp : component.getComponents()) {
            if (comp.isVisible()) {
                return true;
            }
        }
        return false;
    }
385776
function (el) {
        return isElement(el)
            && document.body.contains(el)
            && el.getBoundingClientRect().height > 0
            && el.getBoundingClientRect().width > 0
    }
1207672
function(element) {

      var x, link, image, text, fields;

      // set current element and node
      hashedit.current.element = element;
      hashedit.current.node = element;

      // if the current element is not a [hashedit-element], find the parent that matches
      if(hashedit.current.element.hasAttribute('hashedit-element') === false) {
        hashedit.current.element = hashedit.findParentBySelector(element, '[hashedit-element]');
      }

      // hide #hashedit-image
      image = document.querySelector('#hashedit-image-settings-modal');
      image.removeAttribute('visible');

      // hide #hashedit-link
      link = document.querySelector('#hashedit-link-settings-modal');
      link.removeAttribute('visible');

      // get #hashedit-config
      text = document.querySelector('#hashedit-text-settings');
      text.setAttribute('visible', '');

      // clear form fields
      fields = document.querySelectorAll('[data-model]');

      for (x = 0; x < fields.length; x += 1) {
        if (fields[x].nodeType == 'SELECT') {
          fields[x].selectedIndex = 0;
        } else {
          fields[x].value = '';
        }
      }

      hashedit.bind();

    }