Modify ↓
Ticket #11079 (closed bug: duplicate)
Selector bug: strange interaction between > and :visible
| Reported by: | mikecapp | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | selector | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Demo: http://jsfiddle.net/mikecapp/NgsmC/
jQuery doesn't find a match for the selector "#outer > div:visible span" when the actual DOM path is: (#outer > div > div > span); it looks as though it's erroneously applying the child test to the second, inner div. There's nothing invisible anywhere in this fiddle, but the :visible is definitely needed to trigger the issue.
Change History
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Confirmed. http://jsfiddle.net/timmywil/NgsmC/3/show/
From right to left, the limits the checkSet to the first visible div (the parent of the span), then verifies that #outer is the div's direct parent, which it is not. I'm not sure of a solution yet. Stopping on the first match is usually correct and helps the performance of all descendent selectors.