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/resize-observer/scrollbars.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/resize-observer/scrollbars.html')
-rw-r--r-- | testing/web-platform/tests/resize-observer/scrollbars.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/web-platform/tests/resize-observer/scrollbars.html b/testing/web-platform/tests/resize-observer/scrollbars.html new file mode 100644 index 0000000000..129e74e5cd --- /dev/null +++ b/testing/web-platform/tests/resize-observer/scrollbars.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<title>ResizeObserver content-box size and scrollbars</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1733042"> +<style> + #outer { + position: relative; + width: 100px; + height: 200px; + overflow: auto; + background: #818182; + } + + #inner { + position: absolute; + top: 0; + left: 0; + width: 10px; + height: 10px; + background: #0a6fc0; + } +</style> +<div id="outer"> + <div id="inner"></div> +</div> +<script> + async function animationFrame() { + return new Promise(r => requestAnimationFrame(r)); + } + + // This test is expected to fail with overlay scrollbars. + promise_test(async function() { + let count = 0; + + const outer = document.getElementById('outer'); + const inner = document.getElementById('inner'); + const observer = new ResizeObserver(entries => { + count++; + }); + + observer.observe(outer); + + inner.style.top = '1000px'; + + await animationFrame(); + await animationFrame(); + + inner.style.top = 0; + + await animationFrame(); + await animationFrame(); + + assert_equals(count, 2, "ResizeObserver should subtract scrollbar sizes from content-box rect"); + }); +</script> |