Hi Juriy, That inline script could muddy the water in terms of DOM availability, etc. Perhaps a minor mod:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/prototype/ 1.6.0.3/prototype.js" type="text/javascript"></script> <script type="text/javascript"> document.observe('dom:loaded', function() { $('matchcount').update('Matches: ' + $$ ('.wrapper .inner').length); }); </script> </head> <body> <div class="wrapper"> <a href="#" class="inner">test</a> </div> <div> <div class="wrapper"> <a href="#" class="inner">test</a> </div> </div> <div id='matchcount'></div> </body> </html> I also changed "class" to "inner", again for clear water. FWIW, -- T.J. On Jan 13, 1:20 pm, kangax <[email protected]> wrote: > On Jan 13, 6:26 am, Cyrus <[email protected]> wrote: > > [...] > > > What would you suggest? File a bug report at Opera, Prototype or both? > > I can confirm this with 9.61 on Mac OSX. Here's a minimal failing test > case: > > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" > "http://www.w3.org/TR/html4/strict.dtd"> > <html> > <head> > <title></title> > <script src="http://ajax.googleapis.com/ajax/libs/prototype/ > 1.6.0.3/prototype.js" type="text/javascript"></script> > </head> > <body> > <div class="wrapper"> > <a href="#" class="class">test</a> > </div> > <div> > <div class="wrapper"> > <a href="#" class="class">test</a> > </div> > </div> > <script type="text/javascript"> > document.write($$('.wrapper .class').length); > </script> > </body> > </html> > > Should write "2" but writes "1". > > This looks like an Opera bug. Moreover, I think we already have a > similar ticket filed (which was essentially due to a bug in Opera's > XPath engine bug and the way it handles descendant selectors). For > example, switching to "child" selector ('.wrapper > .class') returns > proper result - "2". > > [...] > > -- > kangax --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
