diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/resize-observer/scrollbars.html | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
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> |