diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /layout/base/tests/chrome/printpreview_images_sw.html | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/base/tests/chrome/printpreview_images_sw.html')
-rw-r--r-- | layout/base/tests/chrome/printpreview_images_sw.html | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/layout/base/tests/chrome/printpreview_images_sw.html b/layout/base/tests/chrome/printpreview_images_sw.html new file mode 100644 index 0000000000..78b8a0dd88 --- /dev/null +++ b/layout/base/tests/chrome/printpreview_images_sw.html @@ -0,0 +1,46 @@ +<!doctype html> +<style> + img, object, svg, input { display: block } + div { + content: url(nonexistent.png?1); + width: 32px; + height: 32px; + } +</style> +<script> +const WORKER = "printpreview_images_sw.js"; +if (location.href.includes("registered")) { + console.log("REGISTERED"); + onload = function() { + postMessage("ready", "*"); + } + onbeforeunload = function() { + navigator.serviceWorker.getRegistrations().then(function(registrations) { + for(let registration of registrations) { + registration.unregister() + } + }) + navigator.serviceWorker.unregister(WORKER); + } +} else { + navigator.serviceWorker.oncontrollerchange = function() { + location.href = location.href + "?registered"; + }; + navigator.serviceWorker.register(WORKER); +} +</script> +<div></div> +<picture> + <source srcset="nonexistent.png?2"> + <img width=32 height=32> +</picture> +<picture> + <source srcset="nonexistent.png?3" media="print"> + <source srcset="animated.gif" media="not print"> + <img width=32 height=32> +</picture> +<img src="nonexistent.png?4" width=32 height=32> +<svg width="32" height="32"> + <image x=0 y=0 href="nonexistent.png?7" width=32 height=32></image> +</svg> +<input type="image" src="nonexistent.png?6" width=32 height=32> |