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/css/css-scroll-anchoring/anonymous-block-box.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/css/css-scroll-anchoring/anonymous-block-box.html')
-rw-r--r-- | testing/web-platform/tests/css/css-scroll-anchoring/anonymous-block-box.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-scroll-anchoring/anonymous-block-box.html b/testing/web-platform/tests/css/css-scroll-anchoring/anonymous-block-box.html new file mode 100644 index 0000000000..97542e2613 --- /dev/null +++ b/testing/web-platform/tests/css/css-scroll-anchoring/anonymous-block-box.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> + +body { height: 2000px; margin: 0 10px; } +#before, #after { height: 100px; } +#before { margin-bottom: 100px; } +#container { line-height: 100px; vertical-align: top; } + +</style> +<div id="container"> + <div id="before">before</div> + <span id="inline">inline</span> + <div id="after">after</div> +</div> +<script> + +// Tests anchoring inside an anonymous block box. The anchor selection algorithm +// should descend into the children of the anonymous box even though it is fully +// contained in the viewport. + +test(() => { + document.scrollingElement.scrollTop = 150; + + var span = document.querySelector("#inline"); + var newSpan = document.createElement("span"); + newSpan.innerHTML = "inserted<br>"; + span.parentNode.insertBefore(newSpan, span); + + assert_equals(document.scrollingElement.scrollTop, 250); +}, "Anchor selection descent into anonymous block boxes."); + +</script> |