Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html

Issue 1047803005: Allow the "img.src='';img.src='.." idiom to clear down images immediately. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script>
3 if (window.testRunner) {
4 testRunner.waitUntilDone();
5 testRunner.dumpAsText();
6 }
7 img = new Image();
8 var testImage = 'resources/green.jpg';
9 img.onload = function(){
10 img.removeAttribute('src');
11 if (img.naturalWidth > 0) {
12 document.getElementById('result').textContent = "FAIL Natural width is : " + img.naturalWidth;
13 if (window.testRunner)
14 testRunner.notifyDone();
15 return;
16 }
17 document.getElementById('result').textContent = "PASS";
18 if (window.testRunner)
19 testRunner.notifyDone();
20 };
21 setTimeout("img.src = '" + testImage + "';", 0);
esprehn 2015/04/06 20:29:40 don't use eval, use a closure.
22 </script>
23 <div id="console">
24 crbug.com/468915: Resetting or removing the src attribute should reset the i mage immediately, rather than waiting for an asynchronous load to do it.<br>
25 </div>
26 <div id="result">FAIL</div>
esprehn 2015/04/06 20:29:40 Would it be possible to use js-test.js instead?
27
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698