Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / htmlcollection-backwards-subtree-iteration.html
blobbc480b895086464fc3c4b82e9b92aa1a004ed9ee
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <img id="1"><img id="2"><img id="3"><img id="4">
5 <script>
7 var errors = '';
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');
22 </script>
23 </body>
24 </html>