diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-empty-src.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-empty-src.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-empty-src.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-empty-src.html new file mode 100644 index 0000000000..2a0aefea1d --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-loading-lazy-empty-src.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html> +<title>Lazy loaded Images handle correctly when setting src to empty</title> +<link rel="help" href="https://html.spec.whatwg.org/multipage/images.html#update-the-image-data"> +<div id=log></div> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<img id="image" loading="lazy" src="resources/image.png"> + +<script> + const image = document.querySelector('#image'); + +async_test(function(t) { + image.onerror = t.step_func(function(e) { + assert_equals(e.type, "error", "null image source check failed"); + image.onload = t.step_func(function() { + t.done(); + }); + image.src = "resources/image.png"; + }); + image.src = ""; +}, "lazy loaded image and empty src"); + +</script> |