OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
4 <img id="img" src="../../images/resources/test-load.jpg"> | 4 <img id="img" src="../../../images/resources/test-load.jpg"> |
5 <script> | 5 <script> |
6 setup({ explicit_done: true }); | 6 setup({ explicit_done: true }); |
7 | 7 |
8 var img = document.getElementById("img"); | 8 var img = document.getElementById("img"); |
9 img.onload = function (e) { | 9 img.onload = function (e) { |
10 var path = e.path; | 10 var path = e.path; |
11 test(function () { | 11 test(function () { |
12 assert_equals(path.length, 4, 'path.length'); | 12 assert_equals(path.length, 4, 'path.length'); |
13 assert_equals(path[0], img, 'path[0] should be img'); | 13 assert_equals(path[0], img, 'path[0] should be img'); |
14 assert_equals(path[1], document.body, 'path[1] should be body'); | 14 assert_equals(path[1], document.body, 'path[1] should be body'); |
15 assert_equals(path[2], document.documentElement, 'path[2] should be html
'); | 15 assert_equals(path[2], document.documentElement, 'path[2] should be html
'); |
16 assert_equals(path[3], document, 'path[3] should be document'); | 16 assert_equals(path[3], document, 'path[3] should be document'); |
17 }, "event.path for img.onload"); | 17 }, "event.path for img.onload"); |
18 done(); | 18 done(); |
19 }; | 19 }; |
20 </script> | 20 </script> |
OLD | NEW |