Opened 12 years ago
Closed 11 years ago
#7205 closed bug (invalid)
subtle difference in how :has() and .has() behave
Reported by: | Tomalak | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | selector | Version: | 1.4.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The ":has()" Sizzle selector and the ".has()" jQuery function behave differently when the child selector ">" is used in a special (unary) way.
The goal is to select elements if they have certain children (not descendants).
$("ul:has(>li.active)"); // returns expected elements $("ul").has(">li.active"); // returns empty
Also see this Fiddle and this StackOverflow thread.
Version info: Tested and reproduced on FireFox 3.6, FireFox 4.0b6, Chrome 8.0.522.0 and IE9b (all Windows). It occurs with jQuery 1.3.2 through 1.4.3.
Change History (3)
comment:1 Changed 12 years ago by
Component: | unfiled → selector |
---|---|
Milestone: | 1.next |
Priority: | undecided → low |
Status: | new → open |
Version: | 1.4.2 → 1.4.3 |
comment:2 Changed 12 years ago by
comment:3 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | open → closed |
Note: See
TracTickets for help on using
tickets.
I have requested clarification on the proper interpretation of "> Child" and resultant selection in the core discussion.