This project is archived and is in readonly mode.

#1218 ✓invalid
Ryan Mitchell

Bug in IE with HTML5 elements

Reported by Ryan Mitchell | April 29th, 2011 @ 01:12 PM | in 1.4.0 (closed)

Hello

I've been struggling with a bug in Mootools 1.3 (which isn't there in 1.2) with regards to HTML5 elements. This only seems to occur on IE8, and is preventing us from using 1.3 instead of 1.2.6

When I use a function like getElement, or getElements, on an element that contains HTML5 elements I get the following errors:

Invalid procedure call or argument - line 2088, character 47
Object doesn't support this property or method - line 5327, character 2

I tracked it down to this code:

if (this.starSelectsClosedQSA) for (i = 0; node = nodes[i++];){
    if (node.nodeName > '@' && !(hasOthers && uniques[this.getUID(node)])) found.push(node);
} else for (i = 0; node = nodes[i++];){
    if (!(hasOthers && uniques[this.getUID(node)])) found.push(node);
}

It seems to be the nodes[i++] thats causing the problem.

Changing the code to the following seems to fix the problem.

if (this.starSelectsClosedQSA){
    for (i = 0; i<nodes.length;i++){
        node = nodes[i];
        if (node.nodeName > '@' && !(hasOthers && uniques[this.getUID(node)])) found.push(node);
    }
} else {
    for (i = 0; i<nodes.length;i++){
        node = nodes[i];
        if (!(hasOthers && uniques[this.getUID(node)])) found.push(node);
    }
}

Any chance of pulling this change in? Its a really frustrating issue, and seems so small and insignificant!

Thanks,
Ryan

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Pages