I don't have problems with absolutely positioned elements, or elements outside the viewport of the browser - they do consume space after all.
Other quirky things:
- <html>
<head>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
</head>
<body>
<div class='abc' style='position: absolute; width: 0px; height: 0px; overflow: hidden'><div class='def' style='width: 50px; height: 50px'>#</div></div> - <div class='ghi' style='outline: 10px solid #ff0000; width: 0px; height: 0px'></div>
<script type='text/javascript'>
$(document).ready(function()
{
console.log($(".abc").is(":visible"), $('.def').is(':visible'), $('.ghi').is(':visible'));
})
</script>
</body>
</html>
outputs false, true, false.
I don't have problems how jQuery works, I don't have problems with what it considers visible, or not - it's working for majority of people! I'm saying that documentation is not precise and if I want to do something I can't look at the documentation, but figure out what's happening from the code and what kind of styling might not be affected by it, as shown with all the above examples. If it were written "a :visible selector affects elements that have bounding box dimensions greater than 0" I'd be satisfied: in the clip bounding box has width: 0px / height: 0px - the content of it would be considered visible, but not the container (the same for outline example).
Edit: As I've said, I've written my own expression:
- $.expr.filters.concealed = function( elem ) {
return ($(elem).add($(elem).parents('*')).filter(function()
{
return $(this).css('opacity') == 0 || $(this).css('visibility') == 'hidden' || ($(this).css('position') == 'absolute' && $(this).css('clip') == 'rect(0px, 0px, 0px, 0px)');
}).length > 0 || $.expr.filters.hidden(elem));
};
Dunno however how buggy is it ;) Thanks for trying though :)