Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / images / natural-dimensions-correct-after-image-reset.html
blobf9c22460c0a0e2961549f16b9b12ef4015d8f30d
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <script>
4 if (window.testRunner) {
5 testRunner.waitUntilDone();
6 testRunner.dumpAsText();
8 img = new Image();
9 var testImage = 'resources/green.jpg';
10 img.onload = function(){
11 img.removeAttribute('src');
12 if (img.naturalWidth > 0) {
13 debug("Natural width is : " + img.naturalWidth + " and should be 0.");
14 if (window.testRunner)
15 testRunner.notifyDone();
16 return;
18 document.getElementById('result').textContent = "PASS";
19 if (window.testRunner)
20 testRunner.notifyDone();
22 setTimeout(function() {
23 img.src = testImage;
24 }, 0);
25 </script>
26 <div id="console">
27 crbug.com/468915: Resetting or removing the src attribute should reset the image immediately, rather than waiting for an asynchronous load to do it.<br>
28 </div>
29 <div id="result">FAIL</div>