avoid random errors where currentStyle is null
handle "Unspecified Error" from getBoundingClientRect()