summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-anchor-position/anchor-scroll-composited-scrolling-001-crash.html
blob: d8fa3821cf5660f7f382bf8aee10c9ddd625b4c1 (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
<!DOCTYPE html>
<title>Tests that anchor-scroll doesn't crash renderer when anchor is in a scroller whose content doesn't overflow</title>
<link rel="author" href="mailto:xiaochengh@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/">
<style>
#container {
  position: relative;
}

#scroller {
  overflow: scroll;
  width: 400px;
  height: 400px;
}

#anchor {
  anchor-name: --a;
  margin: 100px;
  width: 100px;
  height: 100px;
  background: green;
}

#anchored {
  position: absolute;
  anchor-scroll: --a;
  left: anchor(--a left);
  bottom: anchor(--a top);
  width: 100px;
  height: 100px;
  background: orange;
}

</style>

<div id="container">
  <div id="scroller">
    <div id="anchor">anchor</div>
  </div>
  <div id="anchored">anchored</div>
</div>