| <img id="1"><img id="2"><img id="3"><img id="4"> |
| var images = document.images; |
| for (var i = images.length; i > 0; i--) { |
| if (parseInt(images[i - 1].id) != i) |
| errors += 'FAIL - Expected ' + i + ' but got ' + images[i - 1].id + '<br>'; |
| images[i - 1].class = 'foo'; |
| document.body.innerHTML = 'Tests that HTMLCollection of a subtree (as opposed to direct children) can be iterated backwards.<br>' |
| + 'There should be no console error and WebKit should not hit an assertion.<br><br>' + (errors ? errors : 'PASS'); |