I did a bit of snooping and think I've tracked down what the problem
seems to be. In selector.js, I believe the issues emanates from
changes made to the dirCheck function.

In 1.3.2, the match variable is set to the 'elem.sizset' index of the
checkSet array. This checkSet array contains the 'selector validation
status' (my terminology) of a series of sibling divs (in this case).
The following code, in 1.3.2 dirCheck(...), should set the match
variable equal to the element which matches the given selector based
on the current element in checkSet being investigated:
if ( elem.sizcache === doneName ) {
    match = checkSet[elem.sizset];
    break;
}

In the test file, the div in checkSet being investigated is the second
div in the body and elem, in this case, is the div#prev which matches
to the given selector. I believe that match should be set equal to
elem here instead of checkSet[elem.sizset] or, in other words:
- match = checkSet[elem.sizSet];
+ match = elem;

This is similar to how 1.3.1 handles this case. However, I am nowhere
near familiar enough with the selector code to suggest this as a
definitive patch. Does someone who is intimately familiar with the
selector.js code think this would do the trick?

- Gavin

On Mar 6, 8:32 am, Cloudream <[email protected]> wrote:
> nightly is 1.3.1 ...
>
> On Fri, Mar 6, 2009 at 1:30 PM, Igor <[email protected]> wrote:
>
> > Hi!
> > Have been using your library for ages, it is awesome, thank you!
>
> > Recently found some issues, that seems to be related to
> > previousSibling ( "~" ) selector
> > Can you point me to a place, where it is broken, since i afraid of
> > using nightly builds in product
>
> > Sample markup:
> > <html>
> > <head>
> > <!-- 1.3.2. looks like broken -->
> > <script type="text/javascript" src="http://ajax.googleapis.com/ajax/
> > libs/jquery/1.3.2/jquery.min.js"></script>
> > <!-- Nightly. works --> <!--
> > <script type="text/javascript" src="http://code.jquery.com/nightlies/
> > jquery-nightly.js"></script>
> > --><!-- 1.3.1. works --><!--
> > <script type="text/javascript" src="http://ajax.googleapis.com/ajax/
> > libs/jquery/1.3.1/jquery.min.js"></script>
> > -->
> > <script type="text/javascript">
> >        $(document).ready(function(){
> >                console.log($('#prev ~ div').length);/*expecting 1, got zero
> > in
> > 1.3.2*/
> >        });
> > </script>
> > </head>
> > <body>
> >        <div id="prev">1</div>
> >        <div>2</div>
> > </body>
> > </html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to