diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /layout/generic/test/file_reframe_for_lazy_load_image.html | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/generic/test/file_reframe_for_lazy_load_image.html')
-rw-r--r-- | layout/generic/test/file_reframe_for_lazy_load_image.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/layout/generic/test/file_reframe_for_lazy_load_image.html b/layout/generic/test/file_reframe_for_lazy_load_image.html new file mode 100644 index 0000000000..912fbdf3c6 --- /dev/null +++ b/layout/generic/test/file_reframe_for_lazy_load_image.html @@ -0,0 +1,38 @@ +<!doctype html> +<meta charset="utf-8"> +<title> + Test for bug 1612649: We don't reframe for lazy load image state changes. +</title> +<div id="spacer" style="height: calc(100vh + 100px);"></div> +<img id="image" loading="lazy" width="20" height="20" alt="this is an image" + src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAG0lEQVR42mP8z0A%2BYKJA76jmUc2jmkc1U0EzACKcASfOgGoMAAAAAElFTkSuQmCC"> +<script> +const is = opener.is.bind(opener); +const add_task = opener.add_task; +const original_finish = opener.SimpleTest.finish; +const SimpleTest = opener.SimpleTest; +SimpleTest.finish = function finish() { + self.close(); + original_finish(); +} + +const utils = SpecialPowers.DOMWindowUtils; + +add_task(async () => { + await SimpleTest.promiseFocus(); + + const previousConstructCount = utils.framesConstructed; + + const loadPromise = + new Promise(resolve => image.addEventListener("load", resolve)); + + image.scrollIntoView(); + + await loadPromise; + + image.getBoundingClientRect(); + + is(previousConstructCount, utils.framesConstructed, + "We should not have reframed"); +}); +</script> |