gecko-dev/testing/web-platform/tests/scroll-animations/constructor-no-document.html
Stephen McGruer fec5a121a0 Bug 1511876 [wpt PR 14346] - [ScrollTimeline] Begin upstreaming tests to WPT, a=testonly
Automatic update from web-platform-tests
[ScrollTimeline] Begin upstreaming tests to WPT

This CL uploads some basic construction tests for ScrollTimeline. Since
the Chrome implementation still requires timeRange, it is left in for
now (but documented!).

Spec: https://wicg.github.io/scroll-animations

Bug: 911254
Change-Id: Ia7da845eddcd27ea6e7d3fbaf3a008cbdf6d149a
Reviewed-on: https://chromium-review.googlesource.com/c/1354222
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613666}

--

wpt-commits: 164bf82fe832a15740af1b0445e6c59841a0536a
wpt-pr: 14346
2018-12-14 13:54:14 +00:00

19 lines
666 B
HTML

<!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({timeRange: 100});
assert_equals(timeline.scrollSource, null);
assert_equals(timeline.currentTime, null);
}, 'The scrollSource can be null if the document.scrollingElement does not exist');
</script>