I think I've found the problem.

The problem seems to be that IE8 allows you to access the Inputs presents in the form like this:

form.name_of_the_input;

And I've been using an <input name="id" ....

On the line 3294 of prototype, the follow is present:
var oldId = root.id

when you get to 3300 you have
root.id = oldId;

So at that time, root happens to be a FORM, that contains an element with the name="id", the DOM element is retrieved instead of the attribute "id".

Changing:
      case 'selectorsAPI':
        if (root !== document) {
          var oldId = root.id, id = $(root).identify();
          id = id.replace(/([\.:])/g, "\\$1");
          e = "#" + id + " " + e;
        }

        results = $A(root.querySelectorAll(e)).map(Element.extend);
        root.id = oldId;

        return results;

TO:

        if (root !== document) {
          var oldId = root.getAttribute('id'), id = $(root).identify();

          id = id.replace(/([\.:])/g, "\\$1");
          e = "#" + id + " " + e;
          results = $A(root.querySelectorAll(e)).map(Element.extend);
          root.setAttribute('id', oldId);
        }
        else{
          results = $A(root.querySelectorAll(e)).map(Element.extend);
         }

would fix the problem, although I have no idea of performance impact, and how browser compatibility. I also have no idea if the "results = $A(root.querySelectorAll(e)).map(Element.extend);" can be executed before changing the ID of root. That else is there cuz root.setAttribute('id', oldId); won't work with the document.

Is there any workaround ?


On 03-02-2010 12:32, SumolAnanas wrote:
Hello world,

I've been developing something in Firefox, and now I started to check
things in IE8. And I've come across this problem:

When getting a Form as this:

$('id_form'), I can not perform a .select(' .div_inside_the_form ');
or .down( '  .div_inside_the_form  ' );

but, doing up.('   .div_parent_of_the_form ') will work.

As for Firefox and Webkit no problems either

http://pastie.org/807397

Message: Object doesn't support this property or method
Line: 3300
Char: 9
Code: 0
URI: bla bla bla prototype.js

Prototype 1.6.1 (downloaded few min ago)

Maybe this was to be expected, and the exception of working on Firefox
and Webkit is the bug(?).

I've tried to use Element.select(  $('id_form'),
'  .div_inside_the_form  '  )

with no success either.

Thanks in advanced for your time.
P

(IE 8.0.7600.16385 )

--
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.

Reply via email to