summaryrefslogtreecommitdiffstats
path: root/layout/generic/test/test_intrinsic_size_on_loading.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/generic/test/test_intrinsic_size_on_loading.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/generic/test/test_intrinsic_size_on_loading.html53
1 files changed, 53 insertions, 0 deletions
diff --git a/layout/generic/test/test_intrinsic_size_on_loading.html b/layout/generic/test/test_intrinsic_size_on_loading.html
new file mode 100644
index 0000000000..85032f064d
--- /dev/null
+++ b/layout/generic/test/test_intrinsic_size_on_loading.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1205027
+-->
+<head>
+ <title>Test for images intrinsic size while load is pending</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+ <style>
+ body { margin: 0; }
+ img { display: block; }
+ </style>
+ <script>
+ SimpleTest.waitForExplicitFinish();
+ var initialOffsetTop;
+ var finalOffsetTop;
+
+ function report() {
+ finalOffsetTop = marker.offsetTop;
+ is(initialOffsetTop, 0, "initial offsetTop: " + initialOffsetTop);
+ is(finalOffsetTop, 8, "final offsetTop: " + finalOffsetTop);
+ ok(initialOffsetTop < finalOffsetTop, "offsetTop should get larger.");
+ SimpleTest.finish();
+ }
+
+ function fail() {
+ ok(false, "image loading should not fail.");
+ }
+ </script>
+</head>
+<body onload="report();">
+ <!-- Bunch of tiny images: -->
+ <img src="file_SlowImage.sjs" onerror="fail();">
+ <img src="file_SlowImage.sjs" onerror="fail();">
+ <img src="file_SlowImage.sjs" onerror="fail();">
+ <img src="file_SlowImage.sjs" onerror="fail();">
+ <img src="file_SlowImage.sjs" onerror="fail();">
+ <img src="file_SlowImage.sjs" onerror="fail();">
+ <img src="file_SlowImage.sjs" onerror="fail();">
+ <img src="file_SlowImage.sjs" onerror="fail();">
+
+ <div id="marker">Marker div</div>
+ <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1205027">Mozilla Bug 1205027</a>
+ <script>
+ initialOffsetTop = marker.offsetTop;
+ // prompt the sjs "server" to proceed to serve data to our <img> elements
+ var img = new Image();
+ img.onerror = fail;
+ img.src = "file_SlowImage.sjs?continue";
+ </script>
+</body>
+</html>