diff options
Diffstat (limited to '')
-rw-r--r-- | testing/web-platform/tests/css/css-anchor-position/anchor-scroll-chained-003.html | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-chained-003.html b/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-chained-003.html new file mode 100644 index 0000000000..6352ebbfb6 --- /dev/null +++ b/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-chained-003.html @@ -0,0 +1,68 @@ +<!DOCTYPE html> +<title>Tests scroll adjustments of element anchored to another anchored element</title> +<link rel="author" href="mailto:wangxianzhu@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-anchor-1/"> +<link rel="match" href="reference/anchor-scroll-chained-002-ref.html"> +<style> +body { + margin: 0; +} + +div { + width: 100px; + height: 100px; +} + +#scroller1 { + width: 200px; + height: 200px; + position: relative; +} + +#scroller1,#scroller2 { + overflow: scroll; +} + +#anchor { + anchor-name: --a1; + height: 20px; + background: orange; +} + +#anchored1 { + position: absolute; + position-anchor: --a1; + left: anchor(--a1 left); + top: anchor(--a1 bottom); + background: green; + anchor-name: --a2; + z-index: 1; +} + +#anchored2 { + position: absolute; + position-anchor: --a2; + left: anchor(--a2 left); + top: anchor(--a2 bottom); + background: lime; + z-index: 1; +} + +</style> + +<div id="anchored2"></div> +<div id="scroller1"> + <div id="anchored1"></div> + <div style="height: 100px"></div> + <div id="scroller2"> + <div style="height: 230px"></div> + <div id="anchor"></div> + <div style="height: 230px"></div> + </div> + <div style="height: 100px"></div> +</div> + +<script> +scroller1.scrollTop = 80; +scroller2.scrollTop = 200; +</script> |