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 /testing/web-platform/tests/css/cssom-view/scrollIntoView-stuck.tentative.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/cssom-view/scrollIntoView-stuck.tentative.html')
-rw-r--r-- | testing/web-platform/tests/css/cssom-view/scrollIntoView-stuck.tentative.html | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/cssom-view/scrollIntoView-stuck.tentative.html b/testing/web-platform/tests/css/cssom-view/scrollIntoView-stuck.tentative.html new file mode 100644 index 0000000000..115b8ff9fb --- /dev/null +++ b/testing/web-platform/tests/css/cssom-view/scrollIntoView-stuck.tentative.html @@ -0,0 +1,52 @@ +<!doctype html> +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width,minimum-scale=1"> +<title>CSSOM View - scrollIntoView doesn't consider scroll-padding when target is stuck</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-element-scrollintoview"> +<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-1/#scroll-padding"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1795661"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> +body { margin: 0 } +:root { overflow: hidden } +#container { + height: 100vh; + overflow: auto; + scroll-padding-top: 100px; +} +#sticky { + position: sticky; + background: Canvas; + top: 0; +} +#content { + height: 500vh; + background-image: linear-gradient(green, purple); +} +</style> +<div id="container"> + <div id="sticky"> + <input type=text> + </div> + <div id="content"></div> +</div> +<script> +let container = document.getElementById("container"); +let sticky = document.getElementById("sticky"); +test(() => { + // Scroll to the bottom. + container.scrollTo(0, 100000); + + let scrollTop = container.scrollTop; + + assert_not_equals(scrollTop, 0, "Should have scrolled"); + + // Focus on the stuck input. We shouldn't scroll up. + sticky.querySelector("input").scrollIntoView(); + + assert_equals(scrollTop, container.scrollTop, "Shouldn't have scrolled"); +}); +</script> |