src/aria/utils/Dom.js
function (base) {
            var document = base && base.ownerDocument ? base.ownerDocument : Aria.$window.document;
            var scrollLeft = 0;
            var scrollTop = 0;
            var documentScroll = this.getDocumentScrollElement(document);

            if (base != null) {
                var next = base;
                while (next != null) {
                    if (next.scrollLeft) {
                        scrollLeft += next.scrollLeft;
                    }
                    if (next.scrollTop) {
                        scrollTop += next.scrollTop;
                    }
                    next = next.parentNode;
                }
                // now subtract scroll offset of the document
                scrollLeft -= documentScroll.scrollLeft;
                scrollTop -= documentScroll.scrollTop;

            } else {
                scrollLeft = documentScroll.scrollLeft;
                scrollTop = documentScroll.scrollTop;
            }

            // this will be used to insert elements in the body, so body scrolls needs to be taken in consideration also
            if (documentScroll != document.body) {
                scrollLeft += document.body.scrollLeft;
                scrollTop += document.body.scrollTop;
            }

            var scroll = {
                'scrollLeft' : scrollLeft,
                'scrollTop' : scrollTop
            };
            return scroll;
        }
function (base) {
            var document = base && base.ownerDocument ? base.ownerDocument : Aria.$window.document;
            var scrollLeft = 0;
            var scrollTop = 0;
            var documentScroll = this.getDocumentScrollElement(document);

            if (base != null) {
                var next = base;
                while (next != null) {
                    if (next.scrollLeft) {
                        scrollLeft += next.scrollLeft;
                    }
                    if (next.scrollTop) {
                        scrollTop += next.scrollTop;
                    }
                    next = next.parentNode;
                }
                // now subtract scroll offset of the document
                scrollLeft -= documentScroll.scrollLeft;
                scrollTop -= documentScroll.scrollTop;

            } else {
                scrollLeft = documentScroll.scrollLeft;
                scrollTop = documentScroll.scrollTop;
            }

            // this will be used to insert elements in the body, so body scrolls needs to be taken in consideration also
            if (documentScroll != document.body) {
                scrollLeft += document.body.scrollLeft;
                scrollTop += document.body.scrollTop;
            }

            var scroll = {
                'scrollLeft' : scrollLeft,
                'scrollTop' : scrollTop
            };
            return scroll;
        }
function ( base ) { var document = base && base . ownerDocument ? base . ownerDocument : Aria . $window . document ; var scrollLeft = 0 ; var scrollTop = 0 ; var documentScroll = this . getDocumentScrollElement ( document ) ; if ( base != null ) { var next = base ; while ( next != null ) { if ( next . scrollLeft ) { scrollLeft += next . scrollLeft ; } if ( next . scrollTop ) { scrollTop += next . scrollTop ; } next = next . parentNode ; } // now subtract scroll offset of the document scrollLeft -= documentScroll . scrollLeft ; scrollTop -= documentScroll . scrollTop ; } else { scrollLeft = documentScroll . scrollLeft ; scrollTop = documentScroll . scrollTop ; } // this will be used to insert elements in the body, so body scrolls needs to be taken in consideration also if ( documentScroll != document . body ) { scrollLeft += document . body . scrollLeft ; scrollTop += document . body . scrollTop ; } var scroll = { 'scrollLeft' : scrollLeft , 'scrollTop' : scrollTop } ; return scroll ; }
Gets the document scroll distance as a coordinate object.
@parameter {Object} base If provided, the total scrolling offset of the base element is calculated, minus the
scrolling offset of the document element
@return {Object} Object with values 'scrollLeft' and 'scrollTop'.
@protected
Gets the document scroll distance as a coordinate object .