IE 11 may throw an exception when calling .getBoundingClientRect on detached elements. These elements should (according to CSSOM spec) return an object with zero for the top, bottom, left, right, width, and height properties.
http://jsfiddle.net/jonathansampson/3vqddemh/ for the excellent solution to this.
try {
document.createElement('i').getBoundingClientRect();
} catch(e) {
let getBoundingClientRect = Element.prototype.getBoundingClientRect;
Element.prototype.getBoundingClientRect = () => {
try {
return getBoundingClientRect.call(this);
} catch(e) {
return { top: 0, bottom: 0, left: 0, width: 0, height: 0, right: 0 };
}
}
}