summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-animations/scroll-timelines/animation-with-offsets-crash.html
blob: d4d1a5521448611567ecf9ae01e1e753c73e135c (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
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#scrolltimeline-interface">
<style>
.scroller {
  overflow: auto;
  height: 100px;
  width: 100px;
  will-change: transform;
}

.contents {
  height: 1000px;
  width: 100%;
}
</style>
<div class="scroller">
  <div class="contents"></div>
</div>
<script>
  // Test passes if it does not crash.
  // Scroll timeline animations are progress-based and not compatible with
  // delays specified in milliseconds.
  const scroller = document.querySelector('.scroller');
  const animation = new Animation();
  const timeline = animation.timeline;
  const duration = timeline.duration;
  const options = {
    source: scroller,
    scrollOffsets: [new CSSMathInvert(duration)]
  };
  const scroll_timeline = new ScrollTimeline(options);
</script>