-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Core: Remove ancestor visibility requirement from :focusable selector #1583
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
Conversation
956eaf7
to
3aff516
Compare
…anel. Includes an alternative for jQuery UI's `:focusable` selector because it has an ancestor visibility requirement, see jquery/jquery-ui#1583. props westonruter. fixes #33258. git-svn-id: https://develop.svn.wordpress.org/trunk@33596 602fd350-edb4-49c9-b593-d223f7449a82
…anel. Includes an alternative for jQuery UI's `:focusable` selector because it has an ancestor visibility requirement, see jquery/jquery-ui#1583. props westonruter. fixes #33258. Built from https://develop.svn.wordpress.org/trunk@33596 git-svn-id: http://core.svn.wordpress.org/trunk@33563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…anel. Includes an alternative for jQuery UI's `:focusable` selector because it has an ancestor visibility requirement, see jquery/jquery-ui#1583. props westonruter. fixes #33258. Built from https://develop.svn.wordpress.org/trunk@33596 git-svn-id: http://core.svn.wordpress.org/trunk@33563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@westonruter we updated the core file last week ( there is not really a core file any more ) breaking it up into individual modules. Could you rebase / update this to account for that please? |
3aff516
to
1f49e53
Compare
@arschmitz done! |
Diff looks good to me. @arschmitz want to take a look as well? I guess we can take the PR description, put it in a Trac ticket a reference it when merging this PR. |
This looks good to me and will be faster which is good for an already slow selector |
isNotFocusable( "#visibilityHiddenAncestor-input", "input, visibility: hidden parent" ); | ||
isNotFocusable( "#visibilityHiddenAncestor-span", "span with tabindex, visibility: hidden parent" ); | ||
isFocusable( "#visibilityHiddenAncestor-input", "input, visibility: hidden parent" ); | ||
isFocusable( "#visibilityHiddenAncestor-span", "span with tabindex, visibility: hidden parent" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely not correct. You cannot focus something that's not visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scottgonzalez Something can be visible even if (unexpectedly) its ancestor is not visible. See http://jsfiddle.net/westonruter/xuuzv5cu/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that, but this is not what's happening here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@westonruter could you look into this again? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I don't understand what is happening here then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of these elements have visibility: visible
on them, so they're all still hidden.
Every assertion that was changed is incorrect. In addition, the scenario described above isn't actually tested. |
24438a7
to
8bee28d
Compare
* Check computed visibility in addition to :visible * Add tests for nested visibility override
8bee28d
to
175e14f
Compare
Thanks all. I did a deeper dive into this and fixed the issues you identified. Part of my problem was I wasn't that |
Thanks. I've filed a jQuery UI ticket for this and merged it. |
This change caused lots of failures in IE 8. |
Ref #14596 Ref jquerygh-1583
The IE 8 failure was caused by an incorrect default of |
…anel. Includes an alternative for jQuery UI's `:focusable` selector because it has an ancestor visibility requirement, see jquery/jquery-ui#1583. props westonruter. fixes #33258. git-svn-id: https://develop.svn.wordpress.org/trunk@33596 602fd350-edb4-49c9-b593-d223f7449a82
This is news to me, but it turns out that an element that has an ancestor with
visibility:hidden
can itself havevisibility:visible
and it will show that nested element even thought everything in the wrapped elements up to the ancestor will be hidden. Example: http://jsfiddle.net/westonruter/xuuzv5cu/This being the case, the
:focusable
selector needs to remove the check for ancestors being visible.This issue was discovered in a ticket on WordPress Core: https://core.trac.wordpress.org/ticket/33258#comment:10