summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_non_matching_sheet_media.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /layout/style/test/test_non_matching_sheet_media.html
parentInitial commit. (diff)
downloadthunderbird-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 '')
-rw-r--r--layout/style/test/test_non_matching_sheet_media.html30
1 files changed, 30 insertions, 0 deletions
diff --git a/layout/style/test/test_non_matching_sheet_media.html b/layout/style/test/test_non_matching_sheet_media.html
new file mode 100644
index 0000000000..a57444df45
--- /dev/null
+++ b/layout/style/test/test_non_matching_sheet_media.html
@@ -0,0 +1,30 @@
+<!doctype html>
+<!-- https://bugzilla.mozilla.org/show_bug.cgi?id=1386840 -->
+<title>Test for Bug 1386840: non-matching media list doesn't block rendering</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+var t = async_test("Test that <link> doesn't block rendering with non-matching media");
+var loadFired = false;
+var scriptExecuted = false;
+
+function sheetLoaded() {
+ loadFired = true;
+ assert_true(scriptExecuted, "Shouldn't wait for load to execute script");
+ t.done();
+}
+</script>
+<!--
+ NOTE(emilio): This can theoretically race if an HTTP packet boundary with a
+ very long delay came right after the link and before the script. If this
+ ever becomes a problem, the way to fix this is using document.write() as
+ explained in bug 1386840 comment 12.
+-->
+<link rel="stylesheet" href="data:text/css,foo {}" media="print" onload="t.step(sheetLoaded)">
+<script>
+ t.step(function() {
+ scriptExecuted = true;
+ assert_false(loadFired, "Shouldn't have waited for load");
+ });
+</script>