Skip to main content

Bug Tracker

Side navigation

#4104 closed bug (fixed)

Opened February 10, 2009 12:39PM UTC

Closed February 20, 2009 08:03PM UTC

`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)
Change History (5)

Changed February 11, 2009 09:39PM UTC by Pistos comment:1

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.

Changed February 15, 2009 09:13PM UTC by john comment:2

resolution: → fixed
status: newclosed

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

Changed February 20, 2009 03:52PM UTC by Pistos comment:3

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.

Changed February 20, 2009 04:20PM UTC by Pistos comment:4

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

Changed February 20, 2009 08:03PM UTC by john comment:5

resolution: → fixed
status: reopenedclosed