returns the appropriate window.
@method _getWin
@private
@param {HTMLElement} element optional Target element.
@return {Object} The window for the given element or the default window.
517417
function(element) {
        var doc = Y.DOM._getDoc(element);
        return doc[DEFAULT_VIEW] || doc[PARENT_WINDOW] || Y.config.win;
    }
1107946
function filterOnScreen(element) {
                var elementBoundingClientRect = element.getBoundingClientRect();
                // Can't check left/right since it might be scrolled off.
                return elementBoundingClientRect.top < viewportBoundingClientRect.bottom && elementBoundingClientRect.bottom > viewportBoundingClientRect.top;
            }
739470
function makeElementSelectable(element) {
      if (typeof element.onselectstart !== 'undefined') {
        element.onselectstart = null;
      }
      if (selectProp) {
        element.style[selectProp] = '';
      }
      else if (typeof element.unselectable == 'string') {
        element.unselectable = '';
      }
      return element;
    }
156487
function getCssSelectorForElement(element, selectorParts = []) {
			if (isElementNode(element)) {
				const identifier = buildElementIdentifier(element);
				selectorParts.unshift(identifier);
				if (!element.id && element.parentNode) {
					return getCssSelectorForElement(element.parentNode, selectorParts);
				}
			}
			return selectorParts.join(' > ');
		}
96662
function(element) {
			var result = 0;
			var parent = element.parentNode;
			if (parent) {
				var node = parent.firstElementChild;
				while (node) {
					if (node === element) {
						break;
					} else {
						node = node.nextElementSibling;
						result++;
					}
				}
			}
			return result;
		}
1238447
function getClosestTodoElement(element) {

		var matchesSelector = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.msMatchesSelector;

		while (element) {
			if (matchesSelector.bind(element)('li')) {
				return element;
			} else {
				element = element.parentNode;
			}
		}
		return false;

	}
1027244
function getElementForDirection( node )
	{
		while ( node && !( node.getName() in allGuardElements || node.is( 'body' ) ) )
		{
			var parent = node.getParent();
			if ( !parent )
				break;

			node = parent;
		}

		return node;
	}
615847
public static TypeElement getDeclaringClass(Element element) {
    do {
      element = element.getEnclosingElement();
    } while (element != null && !isTypeElement(element));
    return (TypeElement) element;
  }
434390
function(element) {
    var c={};
    try {
      var rect = element.getBoundingClientRect();
      c.x = Math.floor((rect.left + rect.right) / 2);
      c.y = Math.floor((rect.top + rect.bottom) / 2);
    } catch(e) {
      c.x = 1;
      c.y = 1;
    }
    return c;
  }
193599
function () {
        var self = this, elm;

        if (!self.contentWindow) {
          elm = self.iframeElement;

          if (elm) {
            self.contentWindow = elm.contentWindow;
          }
        }

        return self.contentWindow;
      }
764848
function screenPos( element, refWin ) {
				var pos = { x: 0, y: 0 };

				if ( !( element.is( isQuirks ? 'body' : 'html' ) ) ) {
					var box = element.$.getBoundingClientRect();
					pos.x = box.left, pos.y = box.top;
				}

				var win = element.getWindow();
				if ( !win.equals( refWin ) ) {
					var outerPos = screenPos( CKEDITOR.dom.element.get( win.$.frameElement ), refWin );
					pos.x += outerPos.x, pos.y += outerPos.y;
				}

				return pos;
			}
780443
public static Window getWindow(Component component) {

        if (component == null) {
            return null;
        } else if (component instanceof Window) {
            return (Window)component;
        } else {
            return getWindow(component.getParent());
        }

    }
180449
function(element) {
    // return value of html.getBoundingClientRect().top ... IE : 0, other browsers : -pageYOffset
    if(element.nodeName === 'HTML') return -window.pageYOffset
    return element.getBoundingClientRect().top + window.pageYOffset;
}
773852
function selectionGet()
			{
				// for webkit, mozilla, opera
				if (window.getSelection)
					return window.getSelection();
				// for ie
				else if (document.selection && document.selection.createRange && document.selection.type != "None")
					return document.selection.createRange();
			}
429321
public static ExpectedCondition<WebElement> elementToBeClickable(final WebElement element) {
    return new ExpectedCondition<WebElement>() {

      @Override
      public WebElement apply(WebDriver driver) {
        WebElement visibleElement = visibilityOf(element).apply(driver);
        try {
          if (visibleElement != null && visibleElement.isEnabled()) {
            return visibleElement;
          }
          return null;
        } catch (StaleElementReferenceException e) {
          return null;
        }
      }

      @Override
      public String toString() {
        return "element to be clickable: " + element;
      }
    };
  }
165686
private Optional<LocalComponent> getLocalComponentForElement(Element element) {
    String componentName = element.getAttributes().getValue("is");
    if (componentName == null) {
      componentName = element.getStartTag().getName();
    }

    return context.getLocalComponent(componentName);
  }
1270325
function(element){
    element = getEl(element);
    return {
      height : element.offsetHeight,
      width : element.offsetWidth };
  }