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