src/polyfills/resources/IntersectionObserverPolyfill.js
function getBoundingClientRect(el) {
        var rect;

        try {
            rect = el.getBoundingClientRect();
        } catch (err) {
            // Ignore Windows 7 IE11 "Unspecified error"
            // https://github.com/WICG/IntersectionObserver/pull/205
        }

        if (!rect) return getEmptyRect();

        // Older IE
        if (!(rect.width && rect.height)) {
            rect = {
                top: rect.top,
                right: rect.right,
                bottom: rect.bottom,
                left: rect.left,
                width: rect.right - rect.left,
                height: rect.bottom - rect.top
            };
        }
        return rect;
    }
function getBoundingClientRect(el) {
        var rect;

        try {
            rect = el.getBoundingClientRect();
        } catch (err) {
            // Ignore Windows 7 IE11 "Unspecified error"
            // https://github.com/WICG/IntersectionObserver/pull/205
        }

        if (!rect) return getEmptyRect();

        // Older IE
        if (!(rect.width && rect.height)) {
            rect = {
                top: rect.top,
                right: rect.right,
                bottom: rect.bottom,
                left: rect.left,
                width: rect.right - rect.left,
                height: rect.bottom - rect.top
            };
        }
        return rect;
    }
function getBoundingClientRect ( el ) { var rect ; try { rect = el . getBoundingClientRect ( ) ; } catch ( err ) { // Ignore Windows 7 IE11 "Unspecified error" // https://github.com/WICG/IntersectionObserver/pull/205 } if ( ! rect ) return getEmptyRect ( ) ; // Older IE if ( ! ( rect . width && rect . height ) ) { rect = { top : rect . top , right : rect . right , bottom : rect . bottom , left : rect . left , width : rect . right - rect . left , height : rect . bottom - rect . top } ; } return rect ; }
Shims the native getBoundingClientRect for compatibility with older IE.
@param {Element} el The element whose bounding rect to get.
@return {Object} The (possibly shimmed) rect of the element.
Shims the native getBoundingClientRect for compatibility with older IE .