Question: Is there a scenario in which getBoundingClientRectthey window.getComputedStylewill differ in widthor height?
I just found inconsistent width(see below) in IE when an element has box-sizingwhere it window.getComputedStylereturns the wrong value.
So, I thought about overriding only widthand heightwith values getBoundingClientRect, but not sure whether there are cases where this did not happen.
Example problem (in IE): http://jsfiddle.net/bwPM8/
var box = document.querySelector('.box');
var gBCR_width = box.getBoundingClientRect().width;
var wGCS = window.getComputedStyle(box).width;
source
share