OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>crbug.com/468915: Resetting or removing the src attribute should reset th
e image immediately, rather than waiting for an asynchronous load to do it.</tit
le> | 2 <title>crbug.com/468915: Resetting or removing the src attribute should reset th
e image immediately, rather than waiting for an asynchronous load to do it.</tit
le> |
3 <script src="../../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script> | 5 <script> |
6 async_test(function(t) { | 6 async_test(function(t) { |
7 var img = new Image(); | 7 var img = new Image(); |
8 img.onload = t.step_func_done(function() { | 8 img.onload = t.step_func_done(function() { |
9 assert_equals(img.naturalWidth, 16); | 9 assert_equals(img.naturalWidth, 16); |
10 img.removeAttribute('src'); | 10 img.removeAttribute('src'); |
11 assert_equals(img.naturalWidth, 0); | 11 assert_equals(img.naturalWidth, 0); |
12 }); | 12 }); |
13 img.src = 'resources/green.jpg'; | 13 img.src = 'resources/green.jpg'; |
14 }); | 14 }); |
15 </script> | 15 </script> |
OLD | NEW |