Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#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:
Blocked by: Blocking:

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 (3)

comment:1 Changed 7 years ago by timmywil

Component: unfiledselector
Priority: undecidedlow
Status: newopen

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.

comment:2 Changed 7 years ago by timmywil

Resolution: duplicate
Status: openclosed

fixed

comment:3 Changed 7 years ago by timmywil

Duplicate of #11109.

Note: See TracTickets for help on using tickets.