Bug in IE with HTML5 elements #2231

Closed
ibolmo opened this Issue Jan 19, 2012 · 1 comment

1 participant

@ibolmo
MooTools member

(from Lighthouse)

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

@ibolmo
MooTools member

Doesn't seem to be an issue anymore: http://jsfiddle.net/L7Tsc/1/

@ibolmo ibolmo closed this Feb 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment