diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/reftests/scrolling/fractional-scroll-area.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | layout/reftests/scrolling/fractional-scroll-area.html | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/layout/reftests/scrolling/fractional-scroll-area.html b/layout/reftests/scrolling/fractional-scroll-area.html new file mode 100644 index 0000000000..cba421499c --- /dev/null +++ b/layout/reftests/scrolling/fractional-scroll-area.html @@ -0,0 +1,74 @@ +<!DOCTYPE html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>Fractional scroll area position / size</title>
+
+<style>
+
+body {
+ margin: 0;
+}
+
+#scrollbox {
+ width: 200px;
+ overflow: hidden;
+ background: red;
+}
+
+#scrolled-content {
+ background: lime;
+ box-sizing: border-box;
+ border: solid black;
+ border-width: 1px 0;
+}
+
+</style>
+
+<div id="scrollbox">
+ <div id="scrolled-content"></div>
+</div>
+
+<script>
+
+function getFloatQueryParams(defaultValues) {
+ let result = Object.assign({}, defaultValues);
+ for (let chunk of location.search.substr(1).split("&")) {
+ let parts = chunk.split("=");
+ result[parts[0]] = parseFloat(parts[1]);
+ }
+ return result;
+}
+
+let params = getFloatQueryParams({
+ top: 0,
+ outerBottom: 100,
+ innerBottom: 100,
+ borderTop: 0,
+ borderBottom: 0,
+ scrollBefore: 0,
+ scrollAfter: undefined,
+ offsetAfter: undefined,
+});
+
+let scrollArea = document.getElementById("scrollbox");
+let scrolledContent = document.getElementById("scrolled-content");
+
+scrollArea.style.marginTop = params.top + "px";
+scrollArea.style.height = (params.outerBottom - params.top) + "px";
+scrolledContent.style.height = (params.innerBottom - params.top) + "px";
+
+scrollArea.scrollTop = 1;
+scrollArea.scrollTop = 2;
+scrollArea.scrollTop = params.scrollBefore;
+
+window.addEventListener("MozReftestInvalidate", function () {
+ if (params.scrollAfter !== undefined) {
+ scrollArea.scrollTop = params.scrollAfter;
+ }
+ if (params.offsetAfter !== undefined) {
+ document.body.style.marginTop = params.offsetAfter + "px";
+ }
+ document.documentElement.className = "";
+});
+
+</script>
|