summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/already-loaded-image-sync-width.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-img-element/already-loaded-image-sync-width.html')
-rw-r--r--testing/web-platform/tests/html/semantics/embedded-content/the-img-element/already-loaded-image-sync-width.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/already-loaded-image-sync-width.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/already-loaded-image-sync-width.html
new file mode 100644
index 0000000000..4a63bd7a7a
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/already-loaded-image-sync-width.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Image dimensions are available synchronously after changing src to an already-loaded image</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1797798">
+<img id="existing">
+<script>
+ let src = "/images/green.png";
+ let existing = document.getElementById("existing");
+ async_test(function(t) {
+ let tmp = document.createElement("img");
+ tmp.src = src;
+ tmp.onload = t.step_func_done(function() {
+ existing.src = src;
+ assert_equals(existing.width, 100);
+ assert_equals(existing.height, 50);
+ });
+ });
+</script>