Avoid marking image element as complete before its image data is available.

This commit is contained in:
Josh Matthews 2017-02-28 13:45:32 -05:00
parent db79dfb3aa
commit f79850754d
3 changed files with 30 additions and 1 deletions

View file

@ -0,0 +1,17 @@
<html>
<head>
<title>Image element delays window's load event</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<img src="resources/cat.jpg?pipe=trickle(d2)">
<script>
async_test(function(t) {
var saw_img_load = false;
document.querySelector('img').onload = t.step_func(function() {
saw_img_load = true;
});
addEventListener('load', t.step_func_done(function() {
assert_true(saw_img_load);
}));
});
</script>