summaryrefslogtreecommitdiffstats
path: root/layout/printing/crashtests/1758199-1.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /layout/printing/crashtests/1758199-1.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/printing/crashtests/1758199-1.html')
-rw-r--r--layout/printing/crashtests/1758199-1.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/layout/printing/crashtests/1758199-1.html b/layout/printing/crashtests/1758199-1.html
new file mode 100644
index 0000000000..3f7c9227a4
--- /dev/null
+++ b/layout/printing/crashtests/1758199-1.html
@@ -0,0 +1,54 @@
+<html class="reftest-wait">
+<script>
+let pp;
+let documentElements = [];
+documentElements.push(document.documentElement);
+
+window.onload = () => {
+ documentElements.push(document.documentElement);
+
+ let o = document.getElementById('a')
+ o.parentNode.appendChild(o)
+ pp = SpecialPowers.wrap(self).printPreview();
+ pp?.print()
+ window.requestIdleCallback(() => {
+ documentElements.push(document.documentElement);
+
+ document.write('');
+
+ setTimeout(finish, 100);
+ });
+}
+
+function finish() {
+
+ // The printPreview call above actually opens two print preview windows
+ // because the <embed src='#'> below causes a second one to open. At least
+ // we close the one window we can access, not sure if there is a way to get
+ // ahold of the other window to close it. So this test leaves a window open
+ // after it finishes.
+ try { pp.close(); } catch (e) {}
+
+ if (document.documentElement) {
+ try { document.documentElement.className = ""; } catch (e) {}
+ }
+
+ // The documentElement that the reftest harness looks at to determine if the
+ // test is done is not what document.documentElement points to when this code
+ // is run. So we save all the document.documentElement's we encounter while
+ // running this test and clear all of their class names.
+ for (let de of documentElements) {
+ if (de) {
+ try {
+ de.className = "";
+ } catch (e) {}
+ }
+ }
+}
+</script>
+<style>
+:first-of-type { padding-block-start: 99% }
+</style>
+<mark id='a'>
+<embed src='#'>
+</html>