Bug Tracker

Opened 11 years ago

Closed 11 years ago

#4104 closed bug (fixed)

`tag:not(tag.className)` selector fails to return any element in jQuery 1.3.1

Reported by: maranomynet Owned by: john
Priority: major Milestone: 1.3.2
Component: selector Version: 1.3.1
Keywords: not selector Cc:
Blocked by: Blocking:

Description

for this HTML:

<p>Select me.</p>

This happens:

$('p:not(.test)').length     == 1;
$('p:not(div.test)').length  == 1;
$('p').not('p.test').length  == 1;
$('p:not(p.test)').length    == 0; // Fail!

Demo/testcase included.

Attachments (2)

jquery.not-selector-bug-demo.zip (34.5 KB) - added by maranomynet 11 years ago.
jstest.html (1.4 KB) - added by Pistos 11 years ago.
Demo of failures of :not() selector.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by maranomynet

Changed 11 years ago by Pistos

Attachment: jstest.html added

Demo of failures of :not() selector.

comment:1 Changed 11 years ago by Pistos

I've attached some more test cases that I discovered independently. You can view the demo live at http://purepistos.net/tmp/jquery-not-selector-bug.html . The selection sets should all be zero, but often they are 4.

comment:2 Changed 11 years ago by john

Resolution: fixed
Status: newclosed

These ended up being two different bugs - but I've fixed them both. Landed in SVN rev [6206].

comment:3 Changed 11 years ago by Pistos

Resolution: fixed
Status: closedreopened

I just tested 1.3.2 with the same test cases, and although it fixes nearly all of the cases, this one still fails. The set contains 4 found when it should be zero like the rest of them.

comment:4 Changed 11 years ago by Pistos

Oops, sorry, that case IS supposed to return 4. My bad. Please reclose. :)

comment:5 Changed 11 years ago by john

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.