summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-view-transitions/snapshot-containing-block-static-ref.html
blob: 0bff68efb23da1a7bf2189f8bcea4a936faeba94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<title>View transitions: use snapshot containing block for static position (ref)</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
<link rel="author" href="mailto:bokan@chromium.org">

<style>
body {
  height: 400vh;
  background-color: limegreen;
}

div {
  position: absolute;
  left: 200px;
  top: 600px;
  width: 100px;
  height: 100px;

  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;

  background: darkseagreen;
}

</style>

<div id="target">TARGET</div>

<script>
onload = () => {
  const scrollTargetY = document.getElementById('target').offsetTop - 100;
  window.scrollTo(0, scrollTargetY);
};
</script>