As documented, :visible and :hidden only take the css display property into account. They do not consider an element to be visible if it has visibility:hidden, opacity:0, left:-10000px, bottom: 10000px, or other properties that may make it difficult to see the element.