Treat an element as hidden if either offsetWidth or offsetHeight is 0. Fixes #13132, #10406.