:hidden/:visible broken in IE8

:hidden/:visible broken in IE8

The :hidden selector is incorrect for a <button> with style display:none, after some text, in Internet Explorer (tested in IE8). There are possibly other situations in which it is broken, but that's what my testcase reduced to.

It's caused by both offsetWidth and offsetHeight being non-zero, but, despite the specivity of the bug, I'd say it's a problem that should be solved in jQuery. There already seems to be a built-in workaround for <tr> elements.

There's a testcase attached (it needs jQuery copying in).