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

Unified 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: Updated 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/images/natural-dimensions-correct-after-image-reset-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html
diff --git a/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html b/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html
new file mode 100644
index 0000000000000000000000000000000000000000..f9c22460c0a0e2961549f16b9b12ef4015d8f30d
--- /dev/null
+++ b/LayoutTests/fast/images/natural-dimensions-correct-after-image-reset.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<script>
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ }
+ img = new Image();
+ var testImage = 'resources/green.jpg';
+ img.onload = function(){
+ img.removeAttribute('src');
+ if (img.naturalWidth > 0) {
+ debug("Natural width is : " + img.naturalWidth + " and should be 0.");
+ if (window.testRunner)
+ testRunner.notifyDone();
+ return;
+ }
+ document.getElementById('result').textContent = "PASS";
+ if (window.testRunner)
+ testRunner.notifyDone();
+ };
+ setTimeout(function() {
+ img.src = testImage;
+ }, 0);
+</script>
+<div id="console">
+ 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>
+</div>
+<div id="result">FAIL</div>
+
« no previous file with comments | « no previous file | LayoutTests/fast/images/natural-dimensions-correct-after-image-reset-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698