Consider this testcase:
var img = new Image();
img.src = "url1";
img.onload = () => {
img.src = "url2"; // Make sure this is not in the document's loaded-images cache
alert(img.complete);
}
Per spec at https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-complete this should alert true because:
- First bullet does not apply, because there is an src attribute
- Second bullet does not apply, because src is nonempty
- Third bullet, who knows
- Fourth bullet applies (!) because there is a current request and its status is completely available.
Presumably complete should returns false if there is a pending request or something? It consistently returns false in browsers on the above testcase.
@EdgarChen @annevk @domenic