Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some elements are incorrectly excluded in Chrome #3

Open
FesterCluck opened this issue Nov 12, 2014 · 4 comments
Open

Some elements are incorrectly excluded in Chrome #3

FesterCluck opened this issue Nov 12, 2014 · 4 comments

Comments

@FesterCluck
Copy link

In Chrome anchor elements which have sized children (ie: images) are not considered as visible or focusable, and therefore excluded.

This is caused by the difference in the way Chrome reports their offsetWidth and offsetHeight compared to other browsers (Chrome reports 0). This causes jQuery's expr.filters.hidden (":hidden") filter to consider it hidden, and the expr.filters.visible (":visible") filter is just a NOT of hidden.

Using http://api.jquery.com/category/version/1.5/ as a test page will reveal the problem on the books near the bottom. The selector below should get you the 3 elements in question

$("ul.books li a")
@FesterCluck
Copy link
Author

Issue logged with jQuery

jquery/jquery#1855

@FesterCluck
Copy link
Author

It appears this issue finally got the attention it deserved from the jquery team. The change lands in 3.0.0, as can be seen in jquery/jquery#2227. Is there any intention to test this project's compatibility with that version?

@FesterCluck
Copy link
Author

For reference, the new way of determining :visible is

return element.offsetWidth || element.offsetHeight || element.getClientRects().length;

with :hidden simply being a NOT of visible.

@FesterCluck
Copy link
Author

@marklagendijk I'd like to take on this upgrade after the transfer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant