mootools/mootools-core — Issue #2231: Bug in IE with HTML5 elements
Author: ibolmo
Created: 2012-01-19 09:34:02+00:00
State: open
Labels: bug

(from [Lighthouse](https://mootools.lighthouseapp.com/projects/2706/tickets/1218-bug-in-ie-with-html5-elements))

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:

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

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