Hi All,

I found what appears to be a bug in Selector.findChildElements. I'm using
prototype and this behavior was not present in version 1.6.0. I've
experienced this behavior on both IE 7 and FF 2 (didn't test other browsers).

Calling element.descendants() on an input element will call element.select('*')
which in turn calls Selector.findChildElements(element, '*'). This function
returns "undefined" for inputs, but returns an iterable object for other empty
tags such as "hr" and "br", which is very odd (it should either return always
undefined or always return an iterable -empty- object, shouldn't it?).

I didn't go deeper into details about why and where the "bug" exactly is, but I
have this sample code as a proof of concept:

        <form action="whatever.php" method="post"
                <hr id="test-hr" />
                <input id="test-input" type="text" value="whatever" />
                <br id="test-br" />
        <script language="javascript" type="text/javascript">
                document.observe('dom:loaded', function() {
                        // Test HR
                        var hrTest = $('test-hr')
                        var hrDesc = hrTest.descendants();
                        alert(typeof hrDesc);
                        // Test Input
                        var inputTest = $('test-input');
                        var inputDesc = inputTest.descendants();
                        alert(typeof inputDesc);
                        // alert(inputDesc.each); // Uncomment and you get a JS
                        // Test BR
                        var brTest = $('test-br')
                        var brDesc = brTest.descendants();
                        alert(typeof brDesc);

I tried searching trac, but found nothing specific to this issue.



Andrés Robinet | Lead Developer | BESTPLACE CORPORATION 
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308 |
TEL 954-607-4207 | FAX 954-337-2695 | 
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE: bestplace |
 Web: bestplace.biz  | Web: seo-diy.com

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to