summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-view-transitions/snapshot-containing-block-absolute-ref.html
blob: 5f2e780c58f488d924b3043519c9711143de64e7 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html>
<title>View transitions: use snapshot containing block for absolute position (ref)</title>
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/">
<link rel="author" href="mailto:bokan@chromium.org">

<style>
:root {
  background-color: red;
}

body {
  height: 400vh;
}

#target {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 100px;
  height: 100px;

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

  background: darkseagreen;
}

#view-transition {
  position: absolute;
  left: 20px;
  top: 640px;
  width: 700px;
  height: 500px;
  background-color: limegreen;
}

</style>

<div id="view-transition">
  <div id="target">TARGET</div>
</div>

<script>
onload = () => {
  const scrollTargetY = 600;
  window.scrollTo(0, scrollTargetY);
}
</script>