src/aria/utils/Dom.js
function (position, size, base) {
            var viewportSize = this._getViewportSize();
            var documentScroll = this._getDocumentScroll(base);

            if (position.top < documentScroll.scrollTop || position.left < documentScroll.scrollLeft
                    || position.top + size.height > documentScroll.scrollTop + viewportSize.height
                    || position.left + size.width > documentScroll.scrollLeft + viewportSize.width) {
                return false;
            } else {
                return true;
            }
        }
function (position, size, base) {
            var viewportSize = this._getViewportSize();
            var documentScroll = this._getDocumentScroll(base);

            if (position.top < documentScroll.scrollTop || position.left < documentScroll.scrollLeft
                    || position.top + size.height > documentScroll.scrollTop + viewportSize.height
                    || position.left + size.width > documentScroll.scrollLeft + viewportSize.width) {
                return false;
            } else {
                return true;
            }
        }
function ( position , size , base ) { var viewportSize = this . _getViewportSize ( ) ; var documentScroll = this . _getDocumentScroll ( base ) ; if ( position . top < documentScroll . scrollTop || position . left < documentScroll . scrollLeft || position . top + size . height > documentScroll . scrollTop + viewportSize . height || position . left + size . width > documentScroll . scrollLeft + viewportSize . width ) { return false ; } else { return true ; } }
Check if a given position + size couple can fit in the current viewport
@param {aria.utils.DomBeans:Position} position
@param {aria.utils.DomBeans:Size} size
@param {Object} base The base element used to account for scrolling offsets
@return {Boolean} True if the given position+size couple can fit in the current viewport
Check if a given position + size couple can fit in the current viewport