Treat elements as hidden when either offsetWidth OR offsetHeight is 0. Fixes #13132, #10406.