Gets whether an element is potentially focusable without taking current visible/disabled state
into account.
@param {?} element
@return {?}
515259
function isPotentiallyFocusable(element) {
    // Inputs are potentially focusable *unless* they're type="hidden".
    if (isHiddenInput(element)) {
        return false;
    }
    return isNativeFormElement(element) ||
        isAnchorWithHref(element) ||
        element.hasAttribute('contenteditable') ||
        hasValidTabIndex(element);
}
757489
function makeElementUnselectable(element) {
      if (typeof element.onselectstart !== 'undefined') {
        element.onselectstart = fabric.util.falseFunction;
      }
      if (selectProp) {
        element.style[selectProp] = 'none';
      }
      else if (typeof element.unselectable == 'string') {
        element.unselectable = 'on';
      }
      return element;
    }
151538
function( element ) {
            element = $.getElement( element );
            if ( typeof element.style.touchAction !== 'undefined' ) {
                element.style.touchAction = 'none';
            } else if ( typeof element.style.msTouchAction !== 'undefined' ) {
                element.style.msTouchAction = 'none';
            }
        }
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);
}
533696
function (element) {
            if (this.__focusedElement) {
                this.removeVisualFocus();
            }
            this.__focusedElement = element;

            if (this.__style) {
                var document = Aria.$window.document;
                // for anchors and buttons it looks better to have the outline property set directly on them. Otherwise
                // we look for the first span containing the element under focus
                if (this.__focusedElement.tagName != "A" && this.__focusedElement.tagName != "BUTTON") {
                    for (var curNode = this.__focusedElement; curNode.tagName != "SPAN" && curNode != document.body; curNode = curNode.parentNode) {}
                    if (curNode != document.body) {
                        this.__outlinedElement = curNode;
                    }
                } else {
                    this.__outlinedElement = this.__focusedElement;
                }
                if (this.__outlinedElement) {
                    // see comments on top of this.__previousOutline to uderstand the reason for this if statement
                    if (ariaCoreBrowser.isIE8) {
                        this.__previousStyle = this.__outlinedElement.style.cssText;// aria.utils.Dom.getStyle(this.__outlinedElement,
                        // "outline");
                    } else {
                        this.__previousStyle = (this.__outlinedElement.style.outline)
                                ? this.__outlinedElement.style.outline
                                : "";
                    }
                    // finally ste the outline property in inline style attribute
                    this.__outlinedElement.style.outline = this.__style;
                }
            }
        }
996847
function isVisible(elem) {
  return elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
}
342516
function getDirectionality(element) {
	// "If the element's dir attribute is in the ltr state
	//     The directionality of the element is 'ltr'."
	if (element.dir == "ltr") {
		return "ltr";
	}

	// "If the element's dir attribute is in the rtl state
	//     The directionality of the element is 'rtl'."
	if (element.dir == "rtl") {
		return "rtl";
	}

	// "If the element's dir attribute is in the auto state
	// "If the element is a bdi element and the dir attribute is not in a
	// defined state (i.e. it is not present or has an invalid value)
	//     [lots of complicated stuff]
	//
	// Skip this, since no browser implements it anyway.

	// "If the element is a root element and the dir attribute is not in a
	// defined state (i.e. it is not present or has an invalid value)
	//     The directionality of the element is 'ltr'."
	if (!isHtmlElement(element.parentNode)) {
		return "ltr";
	}

	// "If the element has a parent element and the dir attribute is not in a
	// defined state (i.e. it is not present or has an invalid value)
	//     The directionality of the element is the same as the element's
	//     parent element's directionality."
	return getDirectionality(element.parentNode);
}
172130
function getUnstylableParent( element )
	{
		var unstylable,
			editable;

		while ( ( element = element.getParent() ) )
		{
			if ( element.getName() == 'body' )
				break;

			if ( element.getAttribute( 'data-nostyle' ) )
				unstylable = element;
			else if ( !editable )
			{
				var contentEditable = element.getAttribute( 'contentEditable' );

				if ( contentEditable == 'false' )
					unstylable = element;
				else if ( contentEditable == 'true' )
					editable = 1;
			}
		}

		return unstylable;
	}
985505
function(element, delegate) {
            if (this.$el) this.undelegateEvents();
            this.$el = element instanceof $ ? element : $(element);
            this.el = this.$el[0];
            if (delegate !== false) this.delegateEvents();
            return this;
        }
185138
function canFocus(element) {
  return (
    !!element &&
    element.getAttribute('tabindex') !== '-1' &&
    !element.hasAttribute('disabled') &&
    (
      element.hasAttribute('tabindex') ||
      element.hasAttribute('href') ||
      element.isContentEditable ||
      ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA', 'VIDEO', 'AUDIO'].indexOf(element.nodeName) !== -1
    )
  );
}
1343708
public static boolean shouldFocusNode(Context context, AccessibilityNodeInfoCompat node) {
        if (node == null) {
            return false;
        }

        if (!isVisibleOrLegacy(node)) {
            LogUtils.log(AccessibilityNodeInfoUtils.class, Log.VERBOSE,
                    "Don't focus, node is not visible");
            return false;
        }

        if (FILTER_ACCESSIBILITY_FOCUSABLE.accept(context, node)) {
            // TODO: This may still result in focusing non-speaking nodes, but it
            // won't prevent unlabeled buttons from receiving focus.
            if (node.getChildCount() <= 0) {
                LogUtils.log(AccessibilityNodeInfoUtils.class, Log.VERBOSE,
                        "Focus, node is focusable and has no children");
                return true;
            } else if (isSpeakingNode(context, node)) {
                LogUtils.log(AccessibilityNodeInfoUtils.class, Log.VERBOSE,
                        "Focus, node is focusable and has something to speak");
                return true;
            } else {
                LogUtils.log(AccessibilityNodeInfoUtils.class, Log.VERBOSE,
                        "Don't focus, node is focusable but has nothing to speak");
                return false;
            }
        }

        // If this node has no focusable ancestors, but it still has text,
        // then it should receive focus from navigation and be read aloud.
        if (!hasMatchingAncestor(context, node, FILTER_ACCESSIBILITY_FOCUSABLE)
                && hasText(node)) {
            LogUtils.log(AccessibilityNodeInfoUtils.class, Log.VERBOSE,
                    "Focus, node has text and no focusable ancestors");
            return true;
        }

        LogUtils.log(AccessibilityNodeInfoUtils.class, Log.VERBOSE,
                "Don't focus, failed all focusability tests");
        return false;
    }
385776
function (el) {
        return isElement(el)
            && document.body.contains(el)
            && el.getBoundingClientRect().height > 0
            && el.getBoundingClientRect().width > 0
    }
157602
function(element, options) {
    var dispatched, eventFired = false, activeElement = document.activeElement,
      that=this;
    options = options || {};
    // Focus events can't bubble
    options.canBubble = false;
    options.cancelable = false;
    if(activeElement) {
      options.type = 'blur'
      options.relatedTarget = element;
      activeElement.addEventListener(options.type, function blurListener(evt) {
        eventFired = true;
        activeElement.removeEventListener(options.type, blurListener);
      });
      activeElement.blur();
      if(!eventFired) {
        this.dispatchFocusEvent('blur', activeElement, element);
      }
      eventFired = false;
    }
    options.type = 'focus';
    element.addEventListener(options.type, function focusListener(evt) {
      eventFired = true;
      dispatched = !evt.defaultPrevented;
      element.removeEventListener(options.type, focusListener, true);
    });
    element.focus();
    if(!eventFired) {
      dispatched = this.dispatchFocusEvent('focus', element, activeElement);
    }
    return dispatched;
  }
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))
        );
    }
625948
function(element) {
    if (!(element && element.nodeType === 1)) {
      return;
    }
    var _suppressMouseEvents = function(event) {
      if (!(event || (event = _window.event))) {
        return;
      }
      if (event._source !== "js") {
        event.stopImmediatePropagation();
        event.preventDefault();
      }
      delete event._source;
    };
    var _elementMouseOver = function(event) {
      if (!(event || (event = _window.event))) {
        return;
      }
      _suppressMouseEvents(event);
      ZeroClipboard.focus(element);
    };
    element.addEventListener("mouseover", _elementMouseOver, false);
    element.addEventListener("mouseout", _suppressMouseEvents, false);
    element.addEventListener("mouseenter", _suppressMouseEvents, false);
    element.addEventListener("mouseleave", _suppressMouseEvents, false);
    element.addEventListener("mousemove", _suppressMouseEvents, false);
    _mouseHandlers[element.zcClippingId] = {
      mouseover: _elementMouseOver,
      mouseout: _suppressMouseEvents,
      mouseenter: _suppressMouseEvents,
      mouseleave: _suppressMouseEvents,
      mousemove: _suppressMouseEvents
    };
  }
1307870
function( element, index ) {
			if ( typeof index == 'undefined' ) {
				index = this._.focusList.length;
				this._.focusList.push( new Focusable( this, element, index ) );
			} else {
				this._.focusList.splice( index, 0, new Focusable( this, element, index ) );
				for ( var i = index + 1; i < this._.focusList.length; i++ )
					this._.focusList[ i ].focusIndex++;
			}
		}
860604
public static ExpectedCondition<Boolean> invisibilityOfElementLocated(final By locator) {
    return new ExpectedCondition<Boolean>() {
      @Override
      public Boolean apply(WebDriver driver) {
        try {
          return !(driver.findElement(locator).isDisplayed());
        } catch (NoSuchElementException e) {
          // Returns true because the element is not present in DOM. The
          // try block checks if the element is present but is invisible.
          return true;
        } catch (StaleElementReferenceException e) {
          // Returns true because stale element reference implies that element
          // is no longer visible.
          return true;
        }
      }

      @Override
      public String toString() {
        return "element to no longer be visible: " + locator;
      }
    };
  }