summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/scroll-animations/scroll-timelines/constructor-no-document.html
blob: d2cc590bc752af3435f464a668793896d8667930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<meta charset="utf-8">
<title>ScrollTimeline constructor - no document</title>
<link rel="help" href="https://wicg.github.io/scroll-animations/#scrolltimeline-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<script>
'use strict';

test(function() {
  document.documentElement.remove();
  assert_equals(document.scrollingElement, null);

  const timeline = new ScrollTimeline();
  assert_equals(timeline.source, null);
  assert_equals(timeline.currentTime, null);
}, 'The source can be null if the document.scrollingElement does not exist');
</script>