General Sibling Combinator (~) bug

General Sibling Combinator (~) bug

<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey there,<div>
</div><div>I noticed there is a bug with the next general sibling selector "~". It's been there since at least jQuery 1.3.2, and is still present in Revision 6582 from two days ago. I remember seeing a bug reported about this a while ago, but I can't seem to find it anymore.</div><div>
</div><div>It's tricky to pin down where it works and where it doesn't, but basically if the expression is the argument of a method such as find() or children() and the selectors before and after the combinator match, it fails. </div><div>
</div><div>So, these fail:</div><div>
</div><div>$('p').find('strong ~ strong');</div><div>$('div').find('code ~ code');</div><div>
</div><div>But these pass:</div><div>
</div><div><div>$('p').find('strong ~ code');</div><div>$('div').find('code ~strong');</div><div>$('strong ~ strong');</div><div>
</div><div>I put together a little set of tests using QUnit:</div><div>
</div><div><a href="http://test.learningjquery.com/selector-bug/">http://test.learningjquery.com/selector-bug/</a></div><div>
</div><div>I'm wondering if anyone else might have more luck than I've had tracking down the report in Trac. If not, should I file this as a bug?</div><div>
</div><div>Also, in recent SVN versions the siblings() method has been failing tests in the main jQuery test suite. (I think it's happening somewhere in the map function).</div></div><div>
<div>Let me know if there is anything else I can do to help with this.</div><div><br class="webkit-block-placeholder"></div><div apple-content-edited="true"> <span class="Apple-style-span" style="font-size: 13px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div>thanks,</div><div><br class="Apple-interchange-newline">--Karl</div><div><br class="Apple-interchange-newline">____________</div><div>Karl Swedberg</div><div><a href="http://www.englishrules.com">www.englishrules.com</a></div><div><a href="http://www.learningjquery.com">www.learningjquery.com</a></div><div>
</div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"></div></span> </div>
</div>