Problem with selectors in Safari

Problem with selectors in Safari


I encountered a really weird problem in Safari in the 1.3+ releases of
jQuery.
The case: http://jquery.nodnod.net/cases/37 (permanent
http://friedcellcollective.net/js/Cases/select-active.txt)
When you click a node it is marked as selected and all it's parent
nodes are marked as active. When you deselect, it iterates through the
active parent nodes, checking if they have any selected descendants -
if they do, they're left active, otherwise their active state is
removed.
It works in 1.2.6, but doesn't in 1.3 or 1.3.1 in Safari and Chrome.
Buggy behaviour is observed in both .parents(selector) and .find
(selector) as they return some elements that don't match or don't
return elements that match the selector.
The easiest way to reproduce the bug is to select the three smallest
nodes and then deselect them.
I'm guessing I might be trying to get the changes too soon (DOM not
changed yet), but it's still weird.