src/aria/utils/Dom.js
function () {
            if (ariaCoreBrowser.isIOS || ariaCoreBrowser.isAndroid) {
                // Initially (without user-initiated zoom) window's dimensions are the same or nearly the same as
                // documentElement's.
                // Note however that documentElement's clientWidth/Height is unaffected by user zoom while window's
                // innerWidth/Height change on zoom.
                // Also, in Safari on ipad, the viewport resizes when scrolling the page (the address bar is shrinked
                // gradually) and documentElement's size is unaffected, while window's size changes (but in Chrome on
                // mobile, both change).

                // See also http://jakub-g.github.io/quirksmode/widthtest.html
                return {
                    'width' : Aria.$window.innerWidth,
                    'height' : Aria.$window.innerHeight
                };
            } else {
                var docEl = Aria.$window.document.documentElement;
                return {
                    'width' : docEl.clientWidth,
                    'height' : docEl.clientHeight
                };
            }
        }
function () {
            if (ariaCoreBrowser.isIOS || ariaCoreBrowser.isAndroid) {
                // Initially (without user-initiated zoom) window's dimensions are the same or nearly the same as
                // documentElement's.
                // Note however that documentElement's clientWidth/Height is unaffected by user zoom while window's
                // innerWidth/Height change on zoom.
                // Also, in Safari on ipad, the viewport resizes when scrolling the page (the address bar is shrinked
                // gradually) and documentElement's size is unaffected, while window's size changes (but in Chrome on
                // mobile, both change).

                // See also http://jakub-g.github.io/quirksmode/widthtest.html
                return {
                    'width' : Aria.$window.innerWidth,
                    'height' : Aria.$window.innerHeight
                };
            } else {
                var docEl = Aria.$window.document.documentElement;
                return {
                    'width' : docEl.clientWidth,
                    'height' : docEl.clientHeight
                };
            }
        }
function ( ) { if ( ariaCoreBrowser . isIOS || ariaCoreBrowser . isAndroid ) { // Initially (without user-initiated zoom) window's dimensions are the same or nearly the same as // documentElement's. // Note however that documentElement's clientWidth/Height is unaffected by user zoom while window's // innerWidth/Height change on zoom. // Also, in Safari on ipad, the viewport resizes when scrolling the page (the address bar is shrinked // gradually) and documentElement's size is unaffected, while window's size changes (but in Chrome on // mobile, both change). // See also http://jakub-g.github.io/quirksmode/widthtest.html return { 'width' : Aria . $window . innerWidth , 'height' : Aria . $window . innerHeight } ; } else { var docEl = Aria . $window . document . documentElement ; return { 'width' : docEl . clientWidth , 'height' : docEl . clientHeight } ; } }
Gets the dimensions of the viewport. Extracted from Closure's documentation.

<pre>
*
Gecko standards mode:
docEl.clientWidth  Width of viewport excluding scrollbar.
win.innerWidth     Width of viewport including scrollbar.
body.clientWidth   Width of body element.

docEl.clientHeight Height of viewport excluding scrollbar.
win.innerHeight    Height of viewport including scrollbar.
body.clientHeight  Height of document.

Gecko Backwards compatible mode:
docEl.clientWidth  Width of viewport excluding scrollbar.
win.innerWidth     Width of viewport including scrollbar.
body.clientWidth   Width of viewport excluding scrollbar.

docEl.clientHeight Height of document.
win.innerHeight    Height of viewport including scrollbar.
body.clientHeight  Height of viewport excluding scrollbar.

IE6/7 Standards mode:
docEl.clientWidth  Width of viewport excluding scrollbar.
win.innerWidth     Undefined.
body.clientWidth   Width of body element.

docEl.clientHeight Height of viewport excluding scrollbar.
win.innerHeight    Undefined.
body.clientHeight  Height of document element.

IE5 + IE6/7 Backwards compatible mode:
docEl.clientWidth  0.
win.innerWidth     Undefined.
body.clientWidth   Width of viewport excluding scrollbar.

docEl.clientHeight 0.
win.innerHeight    Undefined.
body.clientHeight  Height of viewport excluding scrollbar.

Opera 9 Standards and backwards compatible mode:
docEl.clientWidth  Width of viewport excluding scrollbar.
win.innerWidth     Width of viewport including scrollbar.
body.clientWidth   Width of viewport excluding scrollbar.

docEl.clientHeight Height of document.
win.innerHeight    Height of viewport including scrollbar.
body.clientHeight  Height of viewport excluding scrollbar.

WebKit:
Safari 2
docEl.clientHeight Same as scrollHeight.
docEl.clientWidth  Same as innerWidth.
win.innerWidth     Width of viewport excluding scrollbar.
win.innerHeight    Height of the viewport including scrollbar.
frame.innerHeight  Height of the viewport exluding scrollbar.

Safari 3 (tested in 522)

docEl.clientWidth  Width of viewport excluding scrollbar.
docEl.clientHeight Height of viewport excluding scrollbar in strict mode.
body.clientHeight  Height of viewport excluding scrollbar in quirks mode.
</pre>

@return {aria.utils.DomBeans:Size} Size object width 'width' and 'height' properties
@private
Gets the dimensions of the viewport . Extracted from Closure s documentation .