Fix JS errors when running getBBox() on display: none elements

Was broken in Firefox. This is a temporary fix.