summaryrefslogtreecommitdiffstats
path: root/layout/base/tests/chrome/printpreview_images_sw.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/base/tests/chrome/printpreview_images_sw.html
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
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.html46
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>