Another thing I forgot to mention. In the CSS file, the div has an
absolute position (which is probably why the browser can calculate its
size). After reading the comment in the source:
if (width && (positionedWidth === width)) {
// If the element's width is the same both before and after
// we set absolute positioning, that means:
// (a) it was already absolutely-positioned; or
// (b) it has an explicitly-set width, instead of width:
auto.
// Either way, it means the element is the width it needs to
be
// in order to report an accurate height.
newWidth = getPixelValue(width);
} else if (width && (position === 'absolute' || position ===
'fixed')) {
It would seem that the width should be obtained in 'if' part. However,
there is no width, since element.style.width is empty. On the other
hand, positionedWidth is correct. The 'position' is also absolute, so
it could also go into the else if, but it won't, since the width is
null.