spec/helpers/measurement.js
function getBoundingClientRectCompat ( elem ) {
    var elemRect = elem.getBoundingClientRect();

    if ( elemRect.width === undefined || elemRect.height === undefined ) {
        // Fix for IE8
        elemRect = {
            top: elemRect.top,
            left: elemRect.left,
            bottom: elemRect.bottom,
            right: elemRect.right,
            width:  elemRect.right - elemRect.left,
            height: elemRect.bottom - elemRect.top
        };
    }

    return elemRect;
}
function getBoundingClientRectCompat ( elem ) {
    var elemRect = elem.getBoundingClientRect();

    if ( elemRect.width === undefined || elemRect.height === undefined ) {
        // Fix for IE8
        elemRect = {
            top: elemRect.top,
            left: elemRect.left,
            bottom: elemRect.bottom,
            right: elemRect.right,
            width:  elemRect.right - elemRect.left,
            height: elemRect.bottom - elemRect.top
        };
    }

    return elemRect;
}
function getBoundingClientRectCompat ( elem ) { var elemRect = elem . getBoundingClientRect ( ) ; if ( elemRect . width === undefined || elemRect . height === undefined ) { // Fix for IE8 elemRect = { top : elemRect . top , left : elemRect . left , bottom : elemRect . bottom , right : elemRect . right , width : elemRect . right - elemRect . left , height : elemRect . bottom - elemRect . top } ; } return elemRect ; }
Returns the bounding client rect, including width and height properties. For compatibility with IE8, which
supports getBoundingClientRect but doesn't calculate width and height.

Use only when width and height are actually needed.

Will be removed when IE8 support is dropped entirely.

@param   {HTMLElement} elem
@returns {ClientRect}
Returns the bounding client rect including width and height properties . For compatibility with IE8 which supports getBoundingClientRect but doesn t calculate width and height .