EDIT: Pretty sure it is, or behaviour changes from 1.7.0 onward. Reporting.
I've been trying to isolate a second possible bug (or intentional behaviour change) where there is an inconsistency between 1.7.2 and 1.8.0, but I can't seem to reproduce it in a minimalised code.
But during the process of trying to recreate it I noticed that the following html:
- <html>
- <head>
- <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
- </head>
- <body>
- <script type="text/javascript">
- $('<div class="ch"><div class="chh">chapter 1</div></div>').appendTo("body");
-
- var a;
- $('<div class="ch"><div class="chh">chapter 2</div></div>').appendTo("body");
- a = $("body > .ch:last");
-
- console.log(
- a.prevAll().length);
- console.log(
- a.prevAll(".ch").length);
- console.log(
- a.prevAll(".ch:first").length);
- console.log(
- a.prevAll(".ch:first div:first").length);
- console.log(
- a.prevAll(".ch:first .chh").length);
- </script>
- </body>
- </html>
produces the following output (in any jquery version):
Shouldn't those last two outputs be the same?