Test case for jQuery Ticket

Sizzle problem for Element-rooted incomplete hierarchy-selectors

by jitter

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<div id="divb"></div>
<div></div>
<div></div>

JavaScript

console.log( "#divb ~ div", $("#divb ~ div").length );
console.log( "$('#divb).find('~ div')", $("#divb").find("~ div").length );

//comments
console.log( "\nFails because internally $('#divb).find('~ div') becomes divb.qSA('#divb ~ div') which of course returns 0" );
console.log( "2 of the 4 hierarchy-selectors need to be handled differently for Element-rooted queries in Sizzle" );
console.log( "when they miss the left-hand part of the selector and start with ~ or + " );