src/aria/utils/Dom.js
function (size, base) {
            var viewportSize = this._getViewportSize();
            var documentScroll = this._getDocumentScroll(base);
            return {
                left : parseInt(documentScroll.scrollLeft + (viewportSize.width - size.width) / 2, 10),
                top : parseInt(documentScroll.scrollTop + (viewportSize.height - size.height) / 2, 10)
            };
        }
function (size, base) {
            var viewportSize = this._getViewportSize();
            var documentScroll = this._getDocumentScroll(base);
            return {
                left : parseInt(documentScroll.scrollLeft + (viewportSize.width - size.width) / 2, 10),
                top : parseInt(documentScroll.scrollTop + (viewportSize.height - size.height) / 2, 10)
            };
        }
function ( size , base ) { var viewportSize = this . _getViewportSize ( ) ; var documentScroll = this . _getDocumentScroll ( base ) ; return { left : parseInt ( documentScroll . scrollLeft + ( viewportSize . width - size . width ) / 2 , 10 ) , top : parseInt ( documentScroll . scrollTop + ( viewportSize . height - size . height ) / 2 , 10 ) } ; }
Center the given size in the viewport.
@param {aria.utils.DomBeans:Size} size size of the element to center in the viewport
@param {Object} base The base element used to account for scrolling offsets
@return {aria.utils.DomBeans:Position} position of the element when centered in the viewport
Center the given size in the viewport .